G
Guest
Hi,
I have a report based on a table that is comprised of Field1, Field2, and
Field3
I'd like to have textbox that will display "Field1, Field2, Field3" (as
quoted). Any of those 3 fields can be blank (all of them can be blank as
well) and the textbox needs to adjust itself appropriately. For EX, if
Field2 is blank, it should say "Field1, Field3" and not "Field1, , Field3"
A simple IF statement in VBA would be:
dim myStr as String
myStr = Field1
If Field2 <> "" Then
myStr = "," & Field2
End If
If Field3 <> "" Then
myStr = "," & Field3
End If
But how do I convert this to an IIF statement to put in the ControlSource of
the Textbox?????
Thanks very much for any suggestions!
I have a report based on a table that is comprised of Field1, Field2, and
Field3
I'd like to have textbox that will display "Field1, Field2, Field3" (as
quoted). Any of those 3 fields can be blank (all of them can be blank as
well) and the textbox needs to adjust itself appropriately. For EX, if
Field2 is blank, it should say "Field1, Field3" and not "Field1, , Field3"
A simple IF statement in VBA would be:
dim myStr as String
myStr = Field1
If Field2 <> "" Then
myStr = "," & Field2
End If
If Field3 <> "" Then
myStr = "," & Field3
End If
But how do I convert this to an IIF statement to put in the ControlSource of
the Textbox?????
Thanks very much for any suggestions!