How to make sure that at least one attendee is selected?

G

Guest

Windows XP, MS Access 2000
=======================

I have a form (frmEvent) to enter information for a Program Event, and it
has a subform (sfrmEventAttendee) to enter the names of attendees. The
default view for the subform is Datasheet, and the attendee names are
selected using a combo-box control, and the attendee IDs are stored in a
table (tblEventAttendee), along with the Program Event ID.

According to requirements, there has to be at least one attendee/Program
Event.

My two questions are:
1. What event(s) in frmEvent will have the code to check that at least one
attendee was selected in sfrmEventAttendee? I can think of two - OnClose and
BeforeUpdate . Will these be sufficient?
2. Is DLookup the best way to check for it?

Thanks for your response.

-Amit
 
A

Allen Browne

You have a chicken'n'egg problem here:
- You cannot enter an Attendee, until the Event exists.
- It follows that you cannot require an Attendee before the Event can be
created.

Form_BeforeUpdate won't work. It would be possible to use Form_Unload to
OpenRecordset on an outer join query statement to identify any event that
has no attendee. (The Unmatched query wizard could create this query for
you.)
 

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

Top