delete record form

nikki_k_85

Programer/Analyst Student
Local time
Today, 08:43
Joined
Feb 17, 2005
Messages
14
Okay, I want to make a form with a combo box that you can choose a record and click a button to delete it.

As of now I have the records in the combo box but when i can choose a record... i can't delete. and when i cant choose a record.. i can delete. Can anyone help me???? :confused:
 
ideally, you should paste the code which you are trying to use, so that someone will point out where your problem lies.
 
Here is the code...
Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

DoCmd.RunCommand acCmdDeleteRecord
MsgBox ("WPS Deleted")
Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub


And I have attached a screenshot of the form
 

Attachments

is your combo box in the form bounded to a table or is it unbound ?
 
what's the error that you're getting, because your code looks fine.
 
well as of now... there is no error... i just can't click on the records in the combo box to delete them... but it does delete

when i can click on them i press the button to delete it and only my msgbox saying "WPS deleted" comes up. The record does not delete :confused:
 
i fixed the problem where i can click... it had to do with coming from the switchboard to the form... it needed to be in edit mode :)

but still no error... cant click other entries in the combo box
 
when you're in design go to the properties of your form and check if the Allow Deletions field is set to Yes.
 
I got it.. I had it bound to the table.. instead i bound it to a query and it works... thanks for your help... any questions i have i know where to go!!!! ;)
 
And also how can I get rid of the '#deleted' that appears in the combo when i delete a record
 

Users who are viewing this thread

Back
Top Bottom