report layout

skate

Registered User.
Local time
Today, 19:33
Joined
May 22, 2002
Messages
136
I am having some problems regarding using code in a report (as I've never done this before). I have a function that makes a textbox visible/or not depending on the value of another field MOrder, which is somewhat like an index field but can only be a number from 1 to 12. Normally the report is opened from the form which will only view the report for eg. MOrder=3. When i call the function on Report_Open it says "the expression entered has no value" and refers to my statement If MOrder=3 then....

Any help would be appreciated.

Thanks.
 
skate,

If its dependent on another field, you should use the Detail
Print event to make your test.

Wayne
 
Basically in the report, if MOrder=1 TextboxA.visible=true; MOrder=2 TextboxA.visible=false.

I put this code in the report.

The report is opened from the form by
DoCmd.OpenReport "ReportA", acViewPreview, , "[MIndex] =" & Forms!FormA.MIndex

MIndex is the Key field
MOrder is just a field that identifies a "type" for each record.

Obviously if I were to open the report itself normally I would preview all the records and have various number for MOrder in each record.

Perhaps I am not calling up the MOrder field correctly? How do you call it up in a report?
 
skate,

If there is a field in each record that dictates
whether a field is visible or not, then you have
to use the DetailPrint event to control things.

Wayne
 
where do I find the detail print event? Or how do I use it? I can't seem to find it in the help menu...
(sorry, beginner)
 
skate,

When in Design view for your report, click on the "Detail Bar",
then right-click and choose properties. On the event tab
choose Detail Print. Then [Event Function], Then choose the
three dots at the right margin and put something like:

If Me.Field1 = "Something" Then
Me.Field2.Visible = False
Else
Me.Field2.Visible = True
End If

Wayne
 
thanks so much!

that's exactly what I needed
 

Users who are viewing this thread

Back
Top Bottom