Hi Steve,
Usually you get this error message when you enter this line directly in the
property box, in that case Access looks for a macro.
When the cursor located in the OmPrint property, there is a button with
three dots, click it and select code view.
In the code section enter the code
sub ....()
' For each text box
Me.[TextBox1Name].Visible = Not (Mid([myfield],5,1) = "G" )
Me.[TextBox2Name].Visible = Not (Mid([myfield],5,1) = "G" )
Me.[TextBox3Name].Visible = Not (Mid([myfield],5,1) = "G" )
End Sub
The OnOpen event will work only once, when the report is loaded.
The OnPrint event in the detail section will works for every record printed,
so it will make the fields visible or not depend on the value of myfield in
every record
Good Luck
BS"D
Steve said:
Thanks Ofer Cohen,
But this gives me an error - Can't find Macro "Me." I'm sure I have typed it
as you have suggested.
Also, are you suggesting I put muliple entries in the same line of the
OnPrint event of the detail section for the rest of the text boxes. Are they
separated by any character(s)?
--
Steve
Ofer Cohen said:
You can use the OnPrint event of the detail section where this text boxes
located in, write the code
Me.[TextBoxName].Visible = Not (Mid([myfield],5,1) = "G" )
The same for the rest of the text boxes, just change the name
--
Good Luck
BS"D
:
How do I hide from view (and print), a selection of 6 labels and 5 boxes
from a report based on a condition of the data for each record.
Eg. IIf(Mid[myfield],5,1)="G")
I'm afraid I will need the exact syntax for this please.
Also, based on an earlier reply to Cindy on this subject - I could not get
the following to work in my report.
Report Section -> On Open -> =[myfield].Visible=No
[myfield] still displays!!
Hope you can help... Thanks
Steve