click command button to delete a record which is selected from a combo box ?

M

Martin

In a form's [combo], I can select one of the combo choices and then click a
command button nearby(designed by me) to activate a filt. The command
button's VBA is like below:

Me.Filter = "business NO like '" & Me![Combo270] & "'"
Me.FilterOn = True

YET, my question is:

I want to create another command button (when I click the button) to
delete the record which I have selected from the [combo]. --- How is the
VBA about this command button should be ?

Thanks!

Martin
 
S

Steve Schapel

Martin,

I am pretty sure I understand. Try something like this?...

CurrentDb.Execute "DELETE * FROM YourTable WHERE business ='" &
Me![Combo270] & "'"
 
Top