View Full Version : Urgent problem - facing deadline!!!


wrekless
07-18-2000, 11:18 AM
Need some help quick,
I have a form that has many, many fields, and I've set them all to visible=false.
I use a loop saying basically if the field is populated, then make it visible and assign a .Top value to it, so as to condense the information. The top value is an integer variable that I increment.

The form works fine. The problem is that this same code won't work in the Report, Open Event. Here it is:

If IsNull(Me.Controls(PCField)) = False Then
Me.Controls(FieldName).Visible = True
Me.Controls(FieldName).Top = USDTopPosition
Me.Controls(FieldLabel).Visible = True
Me.Controls(FieldLabel).Top = USDTopPosition
Me.Controls(PCField).Visible = True
Me.Controls(PCField).Top = USDTopPosition
Me.Controls(PCField).Left = 4000
End If

For the report, I get every field, not only the populated ones. Why????

Pat Hartman
07-18-2000, 05:05 PM
Once the visible property is set to true, it is never being reset. You need an else path that sets the visible property to false.

R. Hicks
07-18-2000, 07:01 PM
Also you may need to use the On Activate event of the report instead of the On Open event.

RDH

DML
07-19-2000, 04:52 AM
If the activate button doesn't work for you, then try the On format event of the detail section. Your problem has to do with the timing on the population of the data.

wrekless
07-19-2000, 07:01 AM
Thanks a lot guys, the on format worked for me...Travis actually was the first to get to me, but all your help was VERY much appreciated.