Warning dialogue box at startup

  • Thread starter Thread starter Bugsy
  • Start date Start date
B

Bugsy

Hi I have created an 'events' db for use at work. When starting the db I
would like to be able to display a dialogue box that gives a warning if there
is an event scheduled for that day. Is there a simple way to do this or do I
have to undertake some form of programming, which I am not conversant with!!
Many thanks
 
Create a (continuous view) form to show today's events.

Its source query will have this in the Criteria row under your date field:
Date()

Cancel the Open event procedure of the form if there is nothing to show:

Private Sub Form_Open(Cancel As Integer)
If Me.Recordset.RecordCount = 0 Then
'MsgBox "No records"
Cancel = True
End If
End Sub
 
Hi Allen

Thx very much for the speedy response. Unfortunately I cannot get your
solution to work, obviously something I am not doing correctly!!! I have
created the continous form using the 'today' query with the correct criteria.
I then cancelled the open event procedure as you indicated. and saved the
form

However, when I come to open the form nothing appears to happen, and I have
ensured there are no events for today!! I copied and pasted the code that
you had supplied. Would this cause a problem??

Any ideas??

Thx again
 
Hi Allen

I gave you some duff info there!! Your solution did work but the msg box
doesn't display if there are no events!! Any ideas??
 
Remove the single quote before MsgBox.

Anything on the line after the single quote is considered a comment. It was
intended as an example to show you how to get the MsgBox if you wanted.
(Your original post requesed showing nothing if there was nothing to show.)
 
Sorry Allen a bad explanation from me!! Thanks will give that a go. I
should have said I wanted a warning if there was an event but if nothing go
straight into the db.
 
Back
Top