D
Dale
I have tried the following code three different ways as shown below,
but only one worked, the other two displayed nothing on the word doc.
If someone can explain why that would be great. I am learning VBA and
would like to understand the reasons.
1st Example that didn't display anything on the doc:
Dim strX as String
strX = "X"
If chkFiling.Value = Checked Then
ActiveDocument.FormFields("bkFiling").Result = strX
End If
If chkReflect.Value = Checked Then
ActiveDocument.FormFields("bkReflect").Result = strX
End If
More code . . .
2nd Example that didn't display anything on the doc:
Dim strX as String
strX = "X"
If chkFiling.Value = 1 Then
ActiveDocument.FormFields("bkFiling").Result = strX
End If
If chkReflect.Value = 1 Then
ActiveDocument.FormFields("bkReflect").Result = strX
End If
More code . . .
3rd Example that DOES display something on the doc:
Dim strX as String
strX = "X"
If chkFiling.Value = True Then
ActiveDocument.FormFields("bkFiling").Result = strX
End If
If chkReflect.Value = True Then
ActiveDocument.FormFields("bkReflect").Result = strX
End If
More code . . .
I have read through some books and consulted with my coworkers and I
haven't found why the two did not work. When referring to checkboxes
doesn't .value = (true, 1, or checked) all mean the same? There are
other lines of code dealing with textboxes and optionboxes in the same
procedure, but that shouldn't affect it.
Thanks in advance!
but only one worked, the other two displayed nothing on the word doc.
If someone can explain why that would be great. I am learning VBA and
would like to understand the reasons.
1st Example that didn't display anything on the doc:
Dim strX as String
strX = "X"
If chkFiling.Value = Checked Then
ActiveDocument.FormFields("bkFiling").Result = strX
End If
If chkReflect.Value = Checked Then
ActiveDocument.FormFields("bkReflect").Result = strX
End If
More code . . .
2nd Example that didn't display anything on the doc:
Dim strX as String
strX = "X"
If chkFiling.Value = 1 Then
ActiveDocument.FormFields("bkFiling").Result = strX
End If
If chkReflect.Value = 1 Then
ActiveDocument.FormFields("bkReflect").Result = strX
End If
More code . . .
3rd Example that DOES display something on the doc:
Dim strX as String
strX = "X"
If chkFiling.Value = True Then
ActiveDocument.FormFields("bkFiling").Result = strX
End If
If chkReflect.Value = True Then
ActiveDocument.FormFields("bkReflect").Result = strX
End If
More code . . .
I have read through some books and consulted with my coworkers and I
haven't found why the two did not work. When referring to checkboxes
doesn't .value = (true, 1, or checked) all mean the same? There are
other lines of code dealing with textboxes and optionboxes in the same
procedure, but that shouldn't affect it.
Thanks in advance!