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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One Command Button For Two Subforms

Status
Not open for further replies.

WickedElm

MIS
Jul 11, 2002
13
US
Hi there...I have a main form with two subforms...each subform is based on a different table...I am trying to place command buttons on the main form to perform operations such as "Add New Record", "Save Record", "Delete Record" etc. that will operate for both subforms...my question is how to do this...will access just know what subform the button is referring to, or do I have to signify that with code of some sort...

one idea that i was throwing around was to have two sets of the buttons and setting the "Visible" property depending on what subform is being used...i dont think this is efficient or effective...but just an idea

i guess i'm just looking for a general "how to" on what i should do to go about tackling this task...and then maybe i'll deal with specifics later...thanks for ANY help!!!

Brian
 
Not sure about the delete since I am at work and can't test it out, but I think something like the following shoud work for the adds.

On Click code:

Form(SubFormContainer1Name).AllowAdditions = True
Form(SubFormContainer2Name).AllowAdditions = True

Note that you want the name of the Subform containers on the main form, NOT the actual name of the subform itself.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top