Message Box

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

Guest

I need to create a message box.
Right now what I have going on is when you check a box it sends an email,
then prints, then closes the form, then opens it back up to go on to the next
one. If TA Number is null when it opens I would like an Message Box to
appear saying there are no more travels to be approved. Then an OKAY to
actually close the form.

Can some one show me how to do this?

Thanks
Chey
 
If [Field Value]= "" Then
res = MsgBox("No More Travels to be Approved.", , "Company Name Here")
Exit Sub
 
It didn't work. I palced it under on open. It still opens.

This is what I have

Private Sub Form_Open(Cancel As Integer)
If [TA Number] = "" Then
res = MsgBox("No More Travels to be Approved.", , "Company Name Here")
End If
Exit Sub
End Sub
 
Controls on the Form are not ready to be used in the Open event. The
OnCurrent event fires for each Record when the Record is displayed. Controls
have been initialized to the value of the first Record in the Load event.
If you want to do this once, for the first Record, put your code in the Load
event; if you want to do this for every Record, put it in the Current event.

Larry Linson
Microsoft Access MVP

Chey said:
It didn't work. I palced it under on open. It still opens.

This is what I have

Private Sub Form_Open(Cancel As Integer)
If [TA Number] = "" Then
res = MsgBox("No More Travels to be Approved.", , "Company Name Here")
End If
Exit Sub
End Sub

Corey said:
If [Field Value]= "" Then
res = MsgBox("No More Travels to be Approved.", , "Company Name Here")
Exit Sub
 

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

need help 3
Add some stuff to code 7
Revise code 2
Question Box 2
go to 2
Email in access 4
Email in Access 5
Yes No box 6

Back
Top