Hi,
I have a report that has a query as its record source.
Several of my table fields are stored in codes that I am translating at run time. I've got this VBA code working fine. But something is driving me crazy. I have to have the Code field as a field on my report, in addition to the text field with my translation, even though I am not displaying the Code field on my report. Otherwise, the VBA code where I reference the Code does not work. So I have to include it, and I make it not visible.
I hate to clutter up my report in design view with these invisible fields.
Is it correct that in order to reference a field in VBA, you need to have it on the report itself? It's in my query - can I reference the field in the Query somehow?
My code is:
I would like to delete the text box 'roomname' from my report.
Thanks in advance!
I have a report that has a query as its record source.
Several of my table fields are stored in codes that I am translating at run time. I've got this VBA code working fine. But something is driving me crazy. I have to have the Code field as a field on my report, in addition to the text field with my translation, even though I am not displaying the Code field on my report. Otherwise, the VBA code where I reference the Code does not work. So I have to include it, and I make it not visible.
I hate to clutter up my report in design view with these invisible fields.
Is it correct that in order to reference a field in VBA, you need to have it on the report itself? It's in my query - can I reference the field in the Query somehow?
My code is:
Code:
If RoomName = "GR" Then
txtRoomName = "Guest Room"
ElseIf RoomName = "F" Then
txtRoomName = "Faculty"
End If
Thanks in advance!