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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Don't Print if no data...question??

Status
Not open for further replies.

WB786

MIS
Mar 14, 2002
610
I have a report that will list certain info and if one of the field(s) on the database is not filled in then I don't want this report to print and instead put up a message saying "Can not print. Account number missing!!"

The user will be pressing a button to view/print the report and the report is based on a query which will pull certain fields from the table.

On any given record you can have more than one accounts for a single record or customer.

Let me know if you need more info.

Thanks in advance,
:)WB
 
In your button_Click event:

if IsNull(Me.AccountNumber) then
Msgbox "Sorry - you must enter an account number for this report to print. Please try again"
DoCmd.CancelEvent
Exit Sub
end IF

..and then continue on

Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
Would that work if the table is linked to the main table that stores just account info and customer info in the main table?

:)WB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top