View Full Version : Select?


mikeb
01-29-2002, 05:17 AM
I'm fairly new to access and vb, learn fast but.. not fast enough.
Here is my situation:
tblCustomers
tblEvents
tblEventDetails
1 customer may participate in multiple Events but only ONCE in EACH Event.
My Events form contains (of course) the Event specifics and the details subform allows the user to enter customers (using a unique Customer ID)
The user enters the Customer Id and via the form wizard up pops the correct name taken from the customers table.
As mentioned above the customer may participate in EACH Event only once.
What I have doen is created a form based on a query that opens in hidden mode after exiting the customer id field (it checks if the customer has already participated today).
If the patron has already received a "package" a message is displayed to the user.
My question is this....
How do I get this information (has the patron already recieved a "package" without all these steps which in review are:
1. Info is entered in the Event/Event details form
2. On Exit the Customer field, another form based on a query using criteria from the current event/event details subform opens in hidden mode
3. comparisons between the data on the forms
and
4. Proceed or do not proceed...
Hope someone can point me in the right direction.
Thanks
2.

Pat Hartman
01-29-2002, 07:31 PM
You need another table to record a customer's participation in various events. It should contain a 2-field primary key - CustomerId, EventId - and include a date field so you know when he attended.

Your data entry form would have two combos - one to pick customer and the other to pick event and a field to enter the date. Since the key must be unique, Access will not let you enter the combination of CustomerId and EventId more than once.

mikeb
01-30-2002, 04:35 AM
Pat,
Thank you for your help.
Your suggestion is perfect for my previous suggestion however, in my "application" the user must have the flexibility to over-ride the "proceed" or "do not proceed point".
Having said that, may I ask this:
Am I performing this operation in the correct manner(opening forms in hidden mode) or is there a "lookup" of some sort I should be using. I use the DLookup for in other areas but am not sure if it's logical to use it here.
Soemeone suggested Recordsets.. does that make sense?

mike