Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Subform Record When Changing Option Group Selection

Status
Not open for further replies.

Quintios

Technical User
Mar 7, 2002
482
0
0
US
I have a main form with an option group with eight different radio buttons, each of which corresponds to a different subform. When a particular radio button is selected, the .VISIBLE property of the appropriate subform is set to true and the others are set to false.

What I want to do is, if the enduser selects a different radio button in the control group to change the visible subform, delete the curren record in the subform, but not in the main form.

Thanks in advance,
Q-
 
I had the same problem, here is my solution. It's not pretty but it works.

1. Set the focus to the subform via me.subform
2. Use the code from a delete command button
3. Set the focus back to the trigger

Me.frmCredit_Card_Details.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Me.Payment_Method.SetFocus

N.B.
frmCredit_Card is the subform
Payment_Method is the combo box that is also the trigger.

I know this is 8 months to late, but I hope this can help somebody.
 
Actually, I had some "outside" help from a database-design book author (he asked me to wait a while before publishing his solution, so I won't put his name here or all the gory details).

He put some code togther that would search the other tables for the child table record that contained the same key value and then delete that record, so the record was removed.

But, thank you for your suggestion, even 8 months late. Better late than never!
Onwards,

Q-
 
Quintios, sorry to intrude on the thread but this seemed the easiest way. Earlier in the year there was a discussion about tag databases and you mentioned that had a method for referencing design review and other stuff from within your db:

(TechnicalUser) Mar 26, 2002
Hmm, would that be Bailey, Siemens or Plant 4D? That's a good idea - reference design review / correspondance within the same db. Might I ask how, in general terms, you do that?


Well, the topic came up again at work and I remembered the earlier thread. If you would be so kind, I would appreciate learning a little more about this.

Thanks,

Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top