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!

How do you trigger subform event from parent 1

Status
Not open for further replies.

VicM

Programmer
Sep 24, 2001
444
US
I have a main form containing a subform, which in turn contains a subform. Whenever the main form moves to another record, I want the subform's subform to move to a new record. I'll trigger it from the main form's Current event, but I'm at a loss as to how to structure the syntax in order to make this work.

Any suggestions will be welcomed with gratitude.

Thanks
Vic
 
Usually, the subforms are tied to their parents by a child to parent field relationship.

Did you try that? David Pimental
(US, Oh)
dpimental@checkfree.com
 
Thanks for your suggestion David, but both subforms are already tied to their respective parents with the parent/child fields.

When the form opens and the current record contains associated records in the subform, that subform will display the first of those records.

I would like the subform to display a new record at that time. I can't use the subform's Form_Open event as the subform opens before it's parent and will always start out on a new record until the parent opens; at which time the parent/child relationship takes over.

I want to code the main form's Current event so that each time the main form's record changes, the subform displays a new record and not one of those it's already associated with.

Basically, I don't want the user to scroll thru the subform records to get to make an entry for a new record, since my subform does not contain the navigation bar.

Vic
 
Simple way: Set the DataEntry property of the subform to True in the Current event of the main form.

Sub Form_Current()
Me("SubFormname").Form.DataEntry = True
End Sub

Good luck

[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Thanks Dan I'll give it a shot. Hadn't used that set of properties before. They should prove useful in future designs as well.

Vic
 
If the above excellent suggestion seems to work intermitently, a refresh will clear it up. Depends on which release you have as to whether you have to force it to notice you've made it data entry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top