Deleting From ListBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a one column listbox set to simple. I would like to create a command
button that would delete the items being selected individually. I probably
would have to click the button after each selected item,but How would I code
this. The lisbox is field name is lngVolser.
Also should I prompt as to whether are not if the correct item has been
selected. If yes remove selected and if no clear selected? Do I need to place
a yes/no field on the table.
 
Cyndy,
I have a one column listbox set to simple. I would like to create a command
button that would delete the items being selected individually. I probably
would have to click the button after each selected item,but How would I code
this. The lisbox is field name is lngVolser.

There is no point in setting the list to simple if you want to select only
one value at a time. So lets say you disable multiple select.
I suppose the list box gets its values from a table, so you can make a
delete query set to that table and place the primarykey (autonumber to work)
and the description fields.
In the ID field , set the criteria to
'forms![formname]![listboxname].listindex +1'

Create a button on the form that runs the query.

This should do it
Good Luck!

Also should I prompt as to whether are not if the correct item has been
selected. If yes remove selected and if no clear selected? Do I need to place
a yes/no field on the table.

write a function that pops up an msgbox and write the procedures for each
button (aka OK , Cancel) corresponding to the query.

This should do it
Good Luck!
 
Back
Top