Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amit - 14 Jan 2005 18:53 GMT
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
Allen Browne - 15 Jan 2005 03:43 GMT
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.)

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.

> Windows XP, MS Access 2000
> =======================
[quoted text clipped - 18 lines]
>
> -Amit
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.