Help finalizing code for search/update functions

lscheer

Registered User.
Local time
Today, 22:32
Joined
Jan 20, 2000
Messages
185
I have spent so many hours working on this form and search/capture/update setup, and I'm getting stuck on the last few steps. Any help is appreciated, I'm not sure if my answer lies in VBA or not. I'm attaching an example so anyone interested can see how the problems arise.

Yes, there are multiple problems...so I appreciate any assistance with any of them.

I have a form (frmContacts) that houses contact information for people. One of the most crucial pieces of information is the Tribe/Organization that person is associated with. I have a combo-box based on a query with the limit to list set to YES. On Not In List, I have designed a form to open that will walk the user through a series of steps to add a new tribe or organization to the list. Of course, to try to capture any duplicate entries, I'm requiring them to search first by entering a keyword in an unbound text box on the popup form. Then, if matching results are found they are returned in a list box on the form. All of this works so far.

What I'd like users to be able to do is this:
If they select the option button to add a new Tribe or new organization to the master table, a form with the master table datasheet opens and users can enter the tribe/org. This part works fine, but when users return to the frmContacts, the value they added to the table (which is the underlying table for the combo box), does not appear in the combo box records until after the frmContacts is closed and re-opened. I'd like to avoid having to do this, so I'm wondering if I have the requery method attached to the wrong event (currently, on close of the form where they entered the new value) or the wrong syntax or something.

I know this is a long description for my problem, but this is the only major hurdle I'm facing towards getting this db completely finished, so ANY help is greatly appreciated...even suggestions for other ways of addressing this.

Thanks!
 
lscheer,

Glad to hear that you're close to finishing. When they finish up entering
the new tribe/org. you could use the AfterInsert event. The record has
been successfully added; you can then requery your combo-box on form
contacts.

Wayne
 
I'm not sure this will work. Which AfterInsert event (on which form/control) should I be putting this?

I have tried numerous events to trigger and complete the requery command for the combo box control (tribeorgname), including when the data entry form is closed, unloaded, deactivated, etc. But when it does "work" I get a run-time error #2109 that there is no field "0" in the current record. I believe that's because there is a blank record in the combo box with an ID (bound column) value of "0"...so it's still not working.
 

Users who are viewing this thread

Back
Top Bottom