Delete record harder than it seems

Turbo910

Registered User.
Local time
Today, 16:59
Joined
Nov 8, 2009
Messages
43
Hey guys
On a form i have got a combo box for the Product_Name [Product] and 3 text boxes linked to the combo box to show quantity[Product_Qua], unit[Unit] and section[Section] for the product. They are linked to the combo box by the =[Product].[Column](2) command.

All i want to be able to do is when the user finds the product he/she wants to delete is click a delete command button and there we go record deleted.

Ive tried the wizard but doesnt work and i dont know any code so yeah couldnt write my own script.

Could anyone please give me some instuctions and code or w.e resources i need to be able to do this. Thankyou
smile.gif
 
Usually if the button created by the wizard doesn't work there is a reason.....
These are products? Has a product being deleted been used in another record? If so, do you REALLY want to delete it?
 
Nope atm i have one table with the product info in it and thats all
 
You need to use the Combobox Wizard and use Option Three, which will actually retrieve the record, then use your Wizard generated "delete record" button.

From your description, you're simply pulling the info with the combobox, populating the textboxes and trying to delete it, but that's not the underlying record.
 
Last edited:
So how would i bring the actual underlying record into the form but keeping all the information in seperate text boxes?? rather then just pulling the infomration
 
If you haven't already done so, create a form based on your table or query, including all the fields you want displayed.

Or you can make the form you already have bound to the table/query by setting it as the RecordSource for the form, then for each textbox selecting the appropriate field in the table/query as its Control Source.

Then simply:Add a ComboBox to your form.

The Combobox Wizard will pop up

Select "Find a record based on the value I selected in my combobox."

From the table or query the form is based on, click on the field you're searching by (a field that is unique for each record) to move it to the right side.

Hit Next.

Size the column appropriately.

Hit Next.

Name the ComboBox.

Hit Finish.

Now you can drop the ComboBox down and scroll down to the item to search by, or you can start to enter the item, and the ComboBox will "autofill" as you type. Hit <Enter> and the record will be retrieved.

Once the record is retrieved, a standard Wizard generated Delete Button should work just fine.
 
one question when it deletesa a record, if i type in the combo box to retrieve the record in the first place lets say test1, well then when i press click obv it deletes the record but the name is still remaining in the combo box when what would be ideal is to have a clear form?

Any ideas?
 
You have to requery the combobox after your deletion code runs:

Me.ComboboxName.Requery
 

Users who are viewing this thread

Back
Top Bottom