Refresh combo box list

G

Guest

I have a control (Zip Code) on a main form set to NotInList=Yes. When a user
types in data that is not on this list, the error message appears and a Zip
Code form pops up with an ID (primary key), the zip code field, city, and
state fields. The user can then enter the new information into this form.
This form has a command button to save the record, and one to close the form.
After the form is closed, the combo box list does not update/refresh with
the new data even if you go to another control and then go back to the zip
code control. The only way to get the new data into the list is to close the
main form and reopen it which is inconvenient. Both forms are based on the
tables. Should I the zip code control on the main form maybe be based on a
query instead? Can anyone help me fix this?

Thanks in advance.

SVE
 
W

Wayne Morgan

Do you have the command

Response = acDataErrAdded

after the OpenForm call? Also, are you opening the form using the acDialog
window mode argument to pause the code until you close the form?
 
G

Guest

Thanks for the response.

Actually I used a macro to open the form when the NotInList event occurs.
Would I be better off using vb code? If so, do you have the code to make the
action occur?

Thanks again.
SVE
 
W

Wayne Morgan

Yes, a macro doesn't have all of the options that the VB code has,
especially the parameters that are automatically available in the VB event.
 

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

Similar Threads


Top