How to write this VBA?

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
 
A

Avlan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top