T
Tara via AccessMonster.com
Hey There,
I am newer to the whole Access database environment and am trying to create
a VBA statement that will display a textbox to the user when they enter a
date into the booking Date field tht already exists. It is an event
database and we can't have more than one event on the same date. I have
been playing with the Dlookup function but can't seem to get it to work.
This is what I had:
Private Sub txtBookingDate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("BookingDate", "tblBookings", "BookingDate=" &
Me.BookingDate)) Then
MsgBox "There is already a booking on that Date!"
Cancel = True
End If
End Sub
Am I completely off base?
Many Thanks,
Tara
I am newer to the whole Access database environment and am trying to create
a VBA statement that will display a textbox to the user when they enter a
date into the booking Date field tht already exists. It is an event
database and we can't have more than one event on the same date. I have
been playing with the Dlookup function but can't seem to get it to work.
This is what I had:
Private Sub txtBookingDate_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("BookingDate", "tblBookings", "BookingDate=" &
Me.BookingDate)) Then
MsgBox "There is already a booking on that Date!"
Cancel = True
End If
End Sub
Am I completely off base?
Many Thanks,
Tara