command button print

sysop470

Registered User.
Local time
Yesterday, 18:14
Joined
Mar 25, 2005
Messages
87
I have created a command button that prints a report. The thing is that if the REPORT has no data, i want that the button is INVISIBLE. Is it possible to do this??


Thanks
Andrew
 
Sure it's possible. You would just have to have some code check to see if there are any records with the conditions necessary for them to be included in your report.

Lets say the report prints out items that have a field Pending=true. In the form's On Open Event you can search the table to see if there are any records with Pending=true. If so, make the button visible, else make it not visible.

Larry
 
Hi..

Thanks for your help, but i how can i search for the table from the OPEN EVENT??
 
REcommand button print

In the on open event type

Dim nodata as string

nodata = nz(dlookup("[Columname]"."[Query reportis based on]"),"")

If nodata = "" then

Buttonname.visible=false

end if
 
@smart

Thanks for your help!!! But what do you mean "Query reportis based on"???? What shall i write, can u give me an example


Regards
 
Last edited:
It's assumed that your report is based on a query.
Put that query in [Query reportis based on].
Or when the report is based on a table , put that table in [Query reportis based on].
 

Users who are viewing this thread

Back
Top Bottom