updating combo box after new record added

BradyL

New member
Local time
Today, 17:07
Joined
Jun 5, 2002
Messages
9
I have a combo box which displays a set of data. I have a button on my main form which links to a new form where I can edit a record or create a new one. After editing or creating a new record, I want it to be the selected record in the combobox. Please help! Thanks.

BR,

Brady
 
On the updating form AfterUpdate event, store your new name in the combo box. It's now in the list, so you'll not get any message.

[This message has been edited by llkhoutx (edited 06-06-2002).]
 
You need to requery the combo.

Put the requery in the AfterUpdate event of the add form.

Forms!YourOriginalForm!ComboName.Requery
 
llk, Pat, and others,

Thanks for the help. Your answers work fine if i actually change a record. However, I still want to be able to select a record, not change it, click the close button, and have that record be the selected record. When this is the case the afterUpdate event never happens. If I use deactivate or any event after, the first record is always inserted and not the last record viewed. What can I do?

Thanks a lot,

Brady
 

Users who are viewing this thread

Back
Top Bottom