what is a 2118 error in VBA?

G

Guest

Explain in detail about a 2118 error. I got it when a combo box did not have
a vendor in it's drop down list so an add vendor form was opened so the
vendor could be added. When I got back to the combo box, and execute the
requery, I get the 2118 error which says you must save the current field
before you run the requery action. What's the current field?
 
W

Wayne Morgan

Set LimitToList to Yes. Use the NotInList event to add items. When you've
added the item using the popup form, close the form to let the code continue
to run in the NotInList event. To tell the combo box that you've added the
item, set Response = acDataErrAdded instead of doing a requery.

When you open the popup form, use the acDialog window mode argument in the
DoCmd.OpenForm call. This will cause the code to pause and wait for you to
close or hide the popup form before continuing.
 

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

Top