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

Subform Help

Status
Not open for further replies.

lipin

MIS
Sep 10, 2002
7
0
0
US
OK I have a main form with a subform on it. These are both only for data entry use.

There is a "print notice" button on the subform that opens another form with a subform on it. This subform shows all Mistakes entered for an employee on a given day. WHen I open this Form and Subform there are no records in my subform. But if I click to design view and then right back to form view there are all the records that should have been there. WHat the Hell is going on? I don't do anything in design view. Why does it work like that?

The subform is based on a query, if that helps. It's like its not running the query when the form opens but when I click design view and then click form view it works. I need the records to show when it opens.
 
Not sure exactly what is happening to you. If you put form.requery in the load event of the second form with the problem, does that help? Not sure if it will or not, just something to try. Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
You could also try 'relinking' the child form to the main form e.g.

Private Sub Form_Load()
Me.ChildForm.LinkMasterFields = "Field"
Me.ChildForm.LinkMasterFields = "Field"
me.requery

End Sub

---just a thought, as I have no idea why its doing what it does...but if you solve the problem, I would be curious how you did it.

Cheers,
Dan
 
Trying to requery. Checked help, it said when focus goes to subform hit 'shift f9' and this performs a requery, and that works, but I need it to show like that when the form and subform open. Where shoudl I put requery code?
 
In the subform form's Load Event put: me.form.requery.

Good Luck!

Please remember to give helpful posts the stars they deserve! This makes the post more visible to others in need![thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top