Requery a Sub Form!

B

Bob V

On [frmMain] I have a sub form [subRemindTog] which has a text box
[tbClientName]
From another form how do I requery this subform??
Thanks for any help..........Bob
 
D

dannis

It would be so: Forms![frmMain]!Forms![subRemindTog].Requery

Or you can call to class module representing your subform. If you have any
code in subform then your VBA project exactly has form module
Form_subRemindTog. So, you can do this: Form_subRemindTog.Requery

Note that sometimes you may be needed to use both .Requery and .Repaint
 
B

Bob V

Dannis, Because frmMain does not close I am not getting a requery of my
subform on it, only when i close frmMain and open it, but my subform is
requering in the list with all my other forms.............Thanks Bob

dannis said:
It would be so: Forms![frmMain]!Forms![subRemindTog].Requery

Or you can call to class module representing your subform. If you have any
code in subform then your VBA project exactly has form module
Form_subRemindTog. So, you can do this: Form_subRemindTog.Requery

Note that sometimes you may be needed to use both .Requery and .Repaint

Bob V said:
On [frmMain] I have a sub form [subRemindTog] which has a text box
[tbClientName]
From another form how do I requery this subform??
Thanks for any help..........Bob
 
P

Pieter Wijnen

that would be

Forms![frmMain]!Form![subRemindTog].Requery

Pieter

Bob V said:
Dannis, Because frmMain does not close I am not getting a requery of my
subform on it, only when i close frmMain and open it, but my subform is
requering in the list with all my other forms.............Thanks Bob

dannis said:
It would be so: Forms![frmMain]!Forms![subRemindTog].Requery

Or you can call to class module representing your subform. If you have
any code in subform then your VBA project exactly has form module
Form_subRemindTog. So, you can do this: Form_subRemindTog.Requery

Note that sometimes you may be needed to use both .Requery and .Repaint

Bob V said:
On [frmMain] I have a sub form [subRemindTog] which has a text box
[tbClientName]
From another form how do I requery this subform??
Thanks for any help..........Bob
 
B

Bob V

Pieter I am getting a yellow line error on
Forms![frmMain]!Form![SubRemindTog].Requery
In my AfterUpdate on my text box
I have even tried
Forms![frmMain]!Form![SubRemindTogChild].Requery
As the Name is SubRemindTogChild
Sourse Object is SubRemindTog
Tahnks for your help...........Bob


"Pieter Wijnen"
that would be

Forms![frmMain]!Form![subRemindTog].Requery

Pieter

Bob V said:
Dannis, Because frmMain does not close I am not getting a requery of my
subform on it, only when i close frmMain and open it, but my subform is
requering in the list with all my other forms.............Thanks Bob

dannis said:
It would be so: Forms![frmMain]!Forms![subRemindTog].Requery

Or you can call to class module representing your subform. If you have
any code in subform then your VBA project exactly has form module
Form_subRemindTog. So, you can do this: Form_subRemindTog.Requery

Note that sometimes you may be needed to use both .Requery and .Repaint

"Bob V" <[email protected]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:


On [frmMain] I have a sub form [subRemindTog] which has a text box
[tbClientName]
From another form how do I requery this subform??
Thanks for any help..........Bob
 
P

Pieter Wijnen

you are absolutely sure the control is also named SubRemindTog?
Try declaring everything & see where it fails

ie

Dim MF As Access.Form
Dim SFC As Access.Control
Dim SF As Access.Form

Set MF = Access.Forms("frmMain")
' Set MF = Access.Forms!frmMain
Set C = MF.SubRemindTog
Set SF = C.Form
SF.Requery

HTH

Pieter



Bob V said:
Pieter I am getting a yellow line error on
Forms![frmMain]!Form![SubRemindTog].Requery
In my AfterUpdate on my text box
I have even tried
Forms![frmMain]!Form![SubRemindTogChild].Requery
As the Name is SubRemindTogChild
Sourse Object is SubRemindTog
Tahnks for your help...........Bob


"Pieter Wijnen"
that would be

Forms![frmMain]!Form![subRemindTog].Requery

Pieter

Bob V said:
Dannis, Because frmMain does not close I am not getting a requery of my
subform on it, only when i close frmMain and open it, but my subform is
requering in the list with all my other forms.............Thanks Bob

It would be so: Forms![frmMain]!Forms![subRemindTog].Requery

Or you can call to class module representing your subform. If you have
any code in subform then your VBA project exactly has form module
Form_subRemindTog. So, you can do this: Form_subRemindTog.Requery

Note that sometimes you may be needed to use both .Requery and .Repaint

"Bob V" <[email protected]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:


On [frmMain] I have a sub form [subRemindTog] which has a text box
[tbClientName]
From another form how do I requery this subform??
Thanks for any help..........Bob
 
J

John W. Vinson

that would be

Forms![frmMain]!Form![subRemindTog].Requery

I think that should actually be

Forms![frmMain]![subRemindTog].Form!Requery

where subRemindTog is the name of the subform control on the main form (not
necessarily the same as the name of the form within that control, though it
usually will be). You're using the subform control's Form property to specify
what to requery, so the .Form comes after, not before.

John W. Vinson [MVP]
 
P

Pieter Wijnen

oops, to late at night once again

Pieter

John W. Vinson said:
that would be

Forms![frmMain]!Form![subRemindTog].Requery

I think that should actually be

Forms![frmMain]![subRemindTog].Form!Requery

where subRemindTog is the name of the subform control on the main form
(not
necessarily the same as the name of the form within that control, though
it
usually will be). You're using the subform control's Form property to
specify
what to requery, so the .Form comes after, not before.

John W. Vinson [MVP]
 
B

Bob V

Thanks John, But I am getting a "Syntax Error"
Regards Bob
John W. Vinson said:
that would be

Forms![frmMain]!Form![subRemindTog].Requery

I think that should actually be

Forms![frmMain]![subRemindTog].Form!Requery

where subRemindTog is the name of the subform control on the main form
(not
necessarily the same as the name of the form within that control, though
it
usually will be). You're using the subform control's Form property to
specify
what to requery, so the .Form comes after, not before.

John W. Vinson [MVP]
 
J

John W. Vinson

Thanks John, But I am getting a "Syntax Error"
Regards Bob

Please post: your actual code, the form name, and the Name property of the
Subform control (not necessarily the same as the name of the form inside that
control).

John W. Vinson [MVP]
 
B

Bob V

Sorry Pieter that's a little over my head.....Thanks Bob

"Pieter Wijnen"
you are absolutely sure the control is also named SubRemindTog?
Try declaring everything & see where it fails

ie

Dim MF As Access.Form
Dim SFC As Access.Control
Dim SF As Access.Form

Set MF = Access.Forms("frmMain")
' Set MF = Access.Forms!frmMain
Set C = MF.SubRemindTog
Set SF = C.Form
SF.Requery

HTH

Pieter



Bob V said:
Pieter I am getting a yellow line error on
Forms![frmMain]!Form![SubRemindTog].Requery
In my AfterUpdate on my text box
I have even tried
Forms![frmMain]!Form![SubRemindTogChild].Requery
As the Name is SubRemindTogChild
Sourse Object is SubRemindTog
Tahnks for your help...........Bob


"Pieter Wijnen"
that would be

Forms![frmMain]!Form![subRemindTog].Requery

Pieter

Dannis, Because frmMain does not close I am not getting a requery of my
subform on it, only when i close frmMain and open it, but my subform is
requering in the list with all my other forms.............Thanks Bob

It would be so: Forms![frmMain]!Forms![subRemindTog].Requery

Or you can call to class module representing your subform. If you have
any code in subform then your VBA project exactly has form module
Form_subRemindTog. So, you can do this: Form_subRemindTog.Requery

Note that sometimes you may be needed to use both .Requery and
.Repaint

"Bob V" <[email protected]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:


On [frmMain] I have a sub form [subRemindTog] which has a text box
[tbClientName]
From another form how do I requery this subform??
Thanks for any help..........Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Requery Problem 1
requery field in Sub-SubForm 2
Requery unbound textbox 1
Subform Requery Criteria 1
Format Currency Problem 5
Requery an open form 2
Requery a background form 2
requery 3

Top