Requery Subform not happening

lipin

Registered User.
Local time
Today, 18:57
Joined
May 21, 2002
Messages
149
I have a mainform with a subform when it opens I would like to have all the records in the subform listed. It works fine if I click in the subform and SHIFT+F9 but I can't get it to show the records when it opens.
I have the main form it is with, opens on a control button from a previous form. So do I requery when the main form opens, or in the ON open of the subform?

have tried so many ways, can't get anything to work except shiftF9

tried

forms!mainform!subform.form.requery
forms!mainform!subform.requery
mainform!subform.requery
forms.mainform.subform.form.requery
DoCmd subform.requery

Can't seem to find the right combo to get this to work, not sure where exactly to do it.
 
Have you tried -

DoCmd.Requery(Forms!MainForm!SubForm.Form)

Dave E
 
Dave E- I gave it a try:

Private Sub Form_Open(Cancel As Integer)

DoCmd.Requery (Forms!frmErrorNotice!frmSub1.Form)

End Sub

But I get the error "can't find field frmSub1" but its not a damn field!!! its the subform name. This is the error I've gotten on every damn thing I tried.

Why does it think it is a field? I have no field in any table called frmSub1.
 
Private Sub Form_Open(Cancel As Integer)
Me.SubformName.Requery
End Sub
 
Hey, I tried:

Me.frmSUB1.Requery

and when the form goes to open I get: "Compile Error: Method or Data Member Not Found"

Don't know what else to try
 
frmSUB1 is not the name of your subform, open the main form in design view, click the subform, open the property sheet and get the correct name for your sub
 
Thanks Rich. Got it going, was just named SUB1 but when I went to design view of subform, that was called frmSUB1, didn't think there was a difference. Thanks for pointing that out. Been trying for days to figure out all those errors I kept getting.
 

Users who are viewing this thread

Back
Top Bottom