NotInList questions

  • Thread starter Thread starter M Skabialka
  • Start date Start date
M

M Skabialka

Access97: I have a form where users must enter a customer number for the
Ship to customer and another for the Bill to customer.

There is a table with the CustomerID and CustomerName stored so that I can
use a combo selection for both of these items on the form. The customer
name is not stored but shows on the form in each case.

If the user adds a Customer ID not in the list in either case I
set warnings false
open the customer form
go to a new record
add the CustomerID from the main form
set focus to the name field

There the user adds the customer name and closes the form.

The a message comes up:

The text you entered isn't an item from the list.
Select an item from the list, or enter text that matches one of the listed
items.

How do I
1 - Stop this warning message coming up - I though DoCmd.SetWarnings False
would take care of that
2 - Update the customer name on the main form after the user has added the
new CustomerID and name to the table on the Customer form?

Thanks,
Mich
 
You need to requery the customer combobox either on form_activate or form_gotfocus. (Basically, when the second form closes and you return to the first form.) This will repopulate the combobox to include the newly entered customer info.
 
I tried that but it didn't work.

I solved it by creating a new database using a wizard and found the code on
one of the forms. You have to do it by double-clicking. This works, but
thanks for your reply.

Mich

VickiO100 said:
You need to requery the customer combobox either on form_activate or
form_gotfocus. (Basically, when the second form closes and you return to
the first form.) This will repopulate the combobox to include the newly
entered customer info.
 
Back
Top