delete item from a combo box

E

Emidio

Hi again,
Is there an easy way to delete a item from the combo-box
lookup table by simply pressing the "Del" key when that
item is highlighted?

Thanks
ems
 
R

Richard Choate

You could put a delete button on your form and use it to delete the current
record, and then do a requery for the form so it doesn't show #deleted# in
all of the controls.
Richard

Hi again,
Is there an easy way to delete a item from the combo-box
lookup table by simply pressing the "Del" key when that
item is highlighted?

Thanks
ems
 
E

ems

Thanks for your reply, I'm not trying to delete the
current record. What I'm trying to do is analogous, but
opposite, to appending a typed-in value to a combo-box
list. So that if the user then decides to remove (rather
than add) an item he/she can do it without having to
manually edit the row-source table.

ems
 
E

ems

OK, I'm working with a database of hospital patients. I
have a form with the patient's ID#, name and so forth. I
have a combo box on that form to select what medication
that patient is on from a list of current medications
(tbl_meds_list). Sometimes the patient's medication is not
on that list and it must be entered manually. I have code
in the "notinlist" event for the combo box which prompts
if the new medication is to be added to the current list,
in which case it is appended to tbl_meds_list so that the
next time around the new medication does not have to be
typed in manually. the combo box is used to not only make
a selection but also to enhance the selection list. This
all works great and it is a common modification to the
combo box. But sometimes the user makes a typo in
entering the new medication name and also some medications
are no longer used or the tradename changes or we do not
want it as a choice anymore. In this case the medication
name has to be deleted from tbl_meds_list. The user only
knows how to enter data in a table and find records and
delete patient records, etc. I wanted to have an easy way
for the user to delete an entry from the meds list without
having another command button or menu item on the form.
I hope this better explains what I'm trying to do.

Thanks for your help.
ems
 
E

ems

Richard, Thank you for such a thorough response. I do not
have a many-to-many relationship between the meds table
and the patients. Only one med is assigned per patient.
The meds combo box simply selects a med from the meds
table and inserts it in the patient's med field. The code
I have now works well at intercepting a not-in-list entry
and adding it to the meds list. I simply wanted a way to
remove an item from the meds list in a similar way (see
http://www.mvps.org/access/forms/frm0015.htm).

Anyway, if this cannot be done I will try using your first
option with a check box for a new med and an option to
edit the meds list.

Many thanks
ems
 
E

ems

I want to remove a meds from the meds list only and leave
the patient data alone.
thanks
ems
 

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