Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick question about VBA code on a report.

Status
Not open for further replies.

kjspear

Programmer
Feb 13, 2002
173
US
I had previously posted a question about results from check boxes on reports. That worked fine. But I found out that I needed to use multiple check box results. Please see below;


If Advisory = True Then
Me.memberof.Value = "Advisory Board"
Else
Me.memberof.Value = " "

End If

Now this is in the ON Print of the Detail section of my report. My question is Advisory is not on this report but rather a field in the query. How do I include this field in the code above. The only time it worksed is when I placed this field on the report. But I can't have it on the report itself. I tried Advisory.Vaue=true but I getan 'Object not found error.'

I also need the code to basically say, if Advisory is true then end, if not true then else.

Please let me know if you need more clarification.
 
You can't reference a field unless it is bound to a control. The control does not need to be visible.

However, there is no reason to use any code since all you need is a text box with a control source of:
[blue][tt] =IIf([Advisory],"Advisory Board","")[/tt][/blue]


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top