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

Run click event on button in subform from main form?

Status
Not open for further replies.

Soundsmith

Programmer
Feb 21, 2001
84
US
When Adding a new parent record, I also must add a new child (all parents must have at least one child.)

The Primary key on the main form is a foreign key in the child records on the subform. When adding a new parent,I create a record in the child table with this key and a couple of other pre-fill items for the child. The user needs to add further information on the child record to complete the transaction.

I have a button on the subform that will open the child record for editing in a different form. How can I call this sub ("cmdEditTrans_click") from the main form? David 'Dasher' Kempton
The Soundsmith
 
try:
me![nameOfChildControl]!cmdEditTrans_click.

I think you can reference the click event this way.

Nick
 
Easier than that, try putting your code in a new module instead of relegating it only to the form your control appears on. You can then call that same code from any form in the database. "Databases That Work The Way You Do!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top