Error Message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a command button that prints a report.
I want to create an error message that pops up when a text feild contains a
certain name and also when [Travel Description] and [Facilities] is blank.

If the error message pops up I do not want to print the report. If it does
not pop up I want it to print the report. I already have the report ready to
print with the command button and also a where condition. So I guess I am
trying to get all of these to work together.
Thanks
 
Try this code

If Me.[text field] = "certain name" Or (Isnull(Me.[Travel Description]) and
IsNull(Me.[Facilities])) Then
MsgBox "error message pops up I do not want to print the report"
Else
Docmd.OpenReport "reportName"
End If
========================================
I'm Not sure about the If, mybe this what you are looking for

If Me.[text field] = "certain name" Or Isnull(Me.[Travel Description]) Or
IsNull(Me.[Facilities]) Then
MsgBox "error message pops up I do not want to print the report"
Else
Docmd.OpenReport "reportName"
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Printing a report 2
Can not open any more databases 1
Printing from an "Event Procedure". 3
Blue screen error message 1
Print Report Using a Messagebox 2
Pop up box for report 2
print preview 1
opens a report 2

Back
Top