Onnotinlist problem

Bob M

Registered User.
Local time
Yesterday, 19:08
Joined
Sep 11, 2002
Messages
42
I have two tables OperatorMaster and MachineProduction which have a one to many relationship. The tables have the following fields:

OperatorMaster MachineProduction

OperatorNo OperatorNo
OperatorName ......
.....

When the operator enters a new OperatorNo on the entry screen for MachineProduction, I would like to inform the user and allow them to bring up an entry screen where they would enter the new OperatorNo and OperatorName into the OperatorMaster table then select it from the list.
I used the example in the InventoryControl database which come with Access; to no avail.
Any help would be greatly appeaciated.
 
If you use a combobox for the OperatorNo on the MachineProduction entry screen, the LimitToList property and NotInList event will get you where you need to go.

I would suggest looking up the above mentioned property and event to acclimate you to how it works. But in short, it would go something like this.

Set the LimitToList property on the OperatorNo combobox to true. This will fire the NotInList event when a user enters something other than what is in the list.

In the NotInList event, open a form (recordsource:OperatorMaster table) that allows the user to enter the OperatorNo info. Command box on the form that allows user to save the entry, close the form.

Requery the OperatorNo combobox (it should now have the new entry)

I'm only outlining this for you, because it sounded like you just wanted a push in the right direction. If you need anything more substantial, let me know, and I'll be happy to post some actual code for you.
 
Thanks. That's all I needed. It was the Limit To List option That I missed. I had it set to No, so no matter what I did it wasn't going to check the list for missing entries.

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom