Requery subform from a subform

H

hughess7

Hi all

I have a main form which has no record source and has two continuous
subforms on it. When I move from records on subform1 (frm Plan), I want to
sync with records on subform2 (frm Plan Dates). I can not get this working
:-(.

I've looked at posts on the forum and I have a website re referencing
different control etc and the syntax I use looks ok, but I still get an
error.

I've checked the names of the subform controls and they both seem to
correspond with the actual names.

Help! :)

I've tried various settings and had a mixture of errors mainly - Error 2455
You entered an expression that has an invalid ref...

At the moment I have the following code on the 'On current' event of subform1:

Me![frm Plan Dates].Form.Requery

and get the error:
Error 2465 can't find the field referred to...

Thanks in advance for any help.
Sue
 
D

Douglas J. Steele

Try

Me.Parent![frm Plan Dates].Form.Requery

That assumes that the name of the subform control on the parent form is frm
Plan Dates. Depending on how you added from Plan Dates as a subform, the
name of the subform control can be something different. You need to use the
name of the control if they are different.
 
H

hughess7

YES!!! Big thank you!!

I had tried Me.parent![frm Plan Dates].form.Requery and got error 2455 but
removing the word 'form' worked :).

Sue


Jae said:
Hi!

try

Me.parent![frm Plan Dates].Requery

hughess7 said:
Hi all

I have a main form which has no record source and has two continuous
subforms on it. When I move from records on subform1 (frm Plan), I want to
sync with records on subform2 (frm Plan Dates). I can not get this working
:-(.

I've looked at posts on the forum and I have a website re referencing
different control etc and the syntax I use looks ok, but I still get an
error.

I've checked the names of the subform controls and they both seem to
correspond with the actual names.

Help! :)

I've tried various settings and had a mixture of errors mainly - Error 2455
You entered an expression that has an invalid ref...

At the moment I have the following code on the 'On current' event of subform1:

Me![frm Plan Dates].Form.Requery

and get the error:
Error 2465 can't find the field referred to...

Thanks in advance for any help.
Sue
 

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

Top