Delete records

F

frank

Hello all,

I have a main form that contains two continuous sub
forms. I would like to create a delete button on the main
form that will delete selected records from the active sub
form that has the focus only. How would I do this?

Thanks
 
K

Ken Snell

Won't work that easily....when you click the button on the main form, the
focus will be on the button, not on the subform. So how will the button know
which subform is the one to use? Might be able to use the 'previouscontrol'
property of the Screen object, but that won't be 100% reliable if the user
has navigated somewhere else in between being in the subform and clicking
the button.

Why not put a delete button in the detail section of the subform? It'll
repeat for each record, and when you click it, it'll "know" which record
you're on and which record to delete.
 

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