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

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> 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
[quoted text clipped - 4 lines]
> with!!
> Many thanks
Bugsy - 11 Jan 2008 16:43 GMT
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
> Create a (continuous view) form to show today's events.
>
[quoted text clipped - 18 lines]
> > with!!
> > Many thanks
Bugsy - 11 Jan 2008 19:31 GMT
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??
> Hi Allen
>
[quoted text clipped - 34 lines]
> > > with!!
> > > Many thanks
Allen Browne - 12 Jan 2008 01:53 GMT
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.)

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> 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??
[quoted text clipped - 46 lines]
>> > > with!!
>> > > Many thanks
Bugsy - 13 Jan 2008 10:05 GMT
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.
> Remove the single quote before MsgBox.
>
[quoted text clipped - 52 lines]
> >> > > with!!
> >> > > Many thanks