Referencing to a field not shown in a Report

  • Thread starter Thread starter JohnB
  • Start date Start date
J

JohnB

Hi. I cant find any other posts on this subject, although I though it would
be a common question.

The following On Format code sets the height of a text box based on the
contents of field YearGroup. Both fields are bound to text boxes shown on
the report. How could I reference the YearGroup field if it was in the
reports control source SQL but was not shown as a text field in the report?
Does it matter if the control source is a separate, named, query? The field
YearGroup is in table tblStudents.

If Me!YearGroup = "Yr2" Then
Me!Text40.Height = 5760
End If

Thanks in advance. JohnB
 
I've never been successful at doing it. I simply created a control on the
report and set Visible=No so the data would be present for me.
 
Thanks Bob.

Yes, that's what I've been doing too but surely there is a more elegant way?

Cheers, JohnB
 
Back
Top