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

Message box in a form

Status
Not open for further replies.

Cillies

Technical User
Feb 7, 2003
112
0
0
GB
Hi all,

I am building a database in Access for a video store. I'm at the stage where I want a message box to appear if a video has not been returned before the specified return date.

I am using the [Return Date] and a [Returned] Yes/no check box to register whether a video has not been returned. I have used conditional formatting, but I would also like a message box to appear as soon as the account is open stating that a video has not been returned.

I tried using the below code, but this only works if I click the [Returned] yes/No check box.

Private Sub Form_Current()
If [Return Date] <= Date And [Returned] = False Then
MsgBox "The customer has not returned a video"
Cancel = False
End If
End Sub

Hope someone can help
 
It may be that your check box is not actually false. It could be in it's third state which is grayed out. Try stating "If Not True".

Try...

Code:
Private Sub Form_Current()
If [Return Date] <= Date And [Returned] <> True Then
    MsgBox "The customer has not returned a video"
    Cancel = False
End If
End Sub

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
just as a note...

the greyed out state is actually = null

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top