How to write this VBA?

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

In a form, I click into a combo box and selected one of the record in the
combo box.

And then , I want to click a command button nearby the combo box to delete
this record.

How should I write the VBA about this command button?


Would you please give me an actually example and explain it?

Thank you.


Martin
 
Hm I havent got any samples here, nor tutorials, but I can give you a
hint how to construct your code:

Make the combo box and set the right RowSource.

Make the command button. Put in the code:

1. To read the current value in the combo box (combo.value)
2. Now make a connection to the database in the code, and find the row
to which the selected value belongs
3. Delete that row from the database.

I can't help you further at this moment. The tricky part is making the
connection with your database through the code. Maybe someone else here
can give you the exact code snippet.
 
Back
Top