Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

#delete in combo boxes 1

Status
Not open for further replies.

Kindi

Programmer
Jan 31, 2001
54
0
0
GB
i have a form that deletes a record in a table. The user chooses the relevant record from a combo box, and then click a button that says delete record, once this process is done and the user returns back to the combo box where the record has been a deleted there is #deleted listed in the combo box, but if a user by mistake clicks this there is an horrible error message, what can i do to avoid this, what VBA code could i put in the after update method? please help!
 
You need to requery the combo box to get it to rebuild its list. In your AfterUpdate method, do:
Code:
    cboMyCombo.Requery

Actually, I had a problem with something like this not long ago, so I'm not sure this will work, but give it a try. Rick Sprague
 
Thanks Rick

but i am afraid this did not work, but the reason for this may be because when i created the combo box, access gives you an option to "look up values in a table/query", or the other option is to "find a record on my form based on the value i select in the combo box".

I took the latter option, therefore i think the requery will not work. Any further ideas?

Thanks
Kindi
 
I have just had a thought, i actually need to put the requery statement in the command button that deletes the record from the table, and yes this works, thanks Rick!

Cheers
Kindi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top