View Full Version : deleting


goldstar19821982
02-27-2008, 09:33 AM
hello all,

Just a quick query

I currently have an hires form where clients place orders,
When an item is selected this would drop the item within a listbox and save within a itemhireline table. If clear is selected half way through an order i want the items within the listbox to be deleted from the tblitemhireline so when the next order is placed the listbox should be empty. It sounds pretty simple but i cannot get it to delete all the items that are linked to this itemhireno.

This is what i have been using - it only deletes one item every time the form is cleared

Set rstclear = database.OpenRecordset("Select * from itemhireline Where itemhirno=" & Forms!frmitemhireform!txtitemhireno)
rstclear.Delete

gemma-the-husky
02-27-2008, 12:27 PM
i think this way

i would use a temporary table (similar content to your hired items table) for that purpose. the available items are shown in the list box - as they are selected, they are added to the temporary table, and the list box updated to show unmatched items.

if they acept the order, add the temporary table to the live file

if they cancel the order just clear the temp table and requery the list box