S
SMOO
Good morning,
I have a template with a pop up box...the information entered into the
pop-up box automatically get's put into the form. My problem is...when the
form fields are updated all the other form fields are reset and I lose the
information in them. I of course do not want this to happen. I think the
problem is with the pop-up box code:
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
' Prevent variable from being deleted
If txtDate = "" Then txtDate = " "
ActiveDocument.Variables("Date") = txtDate
If txtClientName = "" Then txtClientName = " "
ActiveDocument.Variables("Client Name") = txtClientName
If txtClientIDNumber = "" Then txtClientIDNumber = " "
ActiveDocument.Variables("Client ID Number") = txtClientIDNumber
' Update fields in document
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update
Unload Me
End Sub
Private Sub txtClientID_Click()
End Sub
Private Sub txtClientIDNumber_Click()
End Sub
Private Sub txtDate_Click()
End Sub
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Initialize()
' Load variables into text boxes
On Error Resume Next
txtDate = ActiveDocument.Variables("Date")
txtClientName = ActiveDocument.Variables("Client Name")
txtClientIDNumber = ActiveDocument.Variables("Client ID Number")
End Sub
How can I tell the code to only update the 3 specific fields without
resetting the whole form?
Thanks,
SMOO
I have a template with a pop up box...the information entered into the
pop-up box automatically get's put into the form. My problem is...when the
form fields are updated all the other form fields are reset and I lose the
information in them. I of course do not want this to happen. I think the
problem is with the pop-up box code:
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
' Prevent variable from being deleted
If txtDate = "" Then txtDate = " "
ActiveDocument.Variables("Date") = txtDate
If txtClientName = "" Then txtClientName = " "
ActiveDocument.Variables("Client Name") = txtClientName
If txtClientIDNumber = "" Then txtClientIDNumber = " "
ActiveDocument.Variables("Client ID Number") = txtClientIDNumber
' Update fields in document
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update
Unload Me
End Sub
Private Sub txtClientID_Click()
End Sub
Private Sub txtClientIDNumber_Click()
End Sub
Private Sub txtDate_Click()
End Sub
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Initialize()
' Load variables into text boxes
On Error Resume Next
txtDate = ActiveDocument.Variables("Date")
txtClientName = ActiveDocument.Variables("Client Name")
txtClientIDNumber = ActiveDocument.Variables("Client ID Number")
End Sub
How can I tell the code to only update the 3 specific fields without
resetting the whole form?
Thanks,
SMOO