code for a command button

G

Guest

My form has two VERY long columns of data. Each row has fields txtA and
txtB. The pkAB is also listed but is not visible. Each visible row is
unique because I have jointly indexed the two visible fields.

I frequently have to add and delete entries. Because the list is so long,
the deletes take a while to just find the approriate record, so I have added
two combo boxes to the header, and a Delete button. I hope to just enter
values into each combo box, then hit cmdDelete.

As a newcomer to code, I sure could use some help with the code for the
on_click event of cmdDelete.
 
M

Mark A. Sam

The delete method is easy. Just put this line in your Button Click event



DoCmd.RunCommand acCmdDeleteRecord



I'm not sure about the other part where you want to select from two combos.
Do you have the code to find the records are looking for help in that area.
If so, the best thing to do is have a unique index to search on, and usually
an Autonumber field fills that functionality well. If you have a unique key,
tell me the name of that field and the name of the Combo and I will tell you
how to work it.

God Bless,

Mark A. Sam
 

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