Requery subform syntax

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

What is the correct syntax to requery a subform and is it the same from the
parent form as it would be from a 2nd open form? See samples below:

1. Forms!formname!subformcontrolname.Requery
or
2. Forms!formname!subformcontrolname.Form.Requery

Thank you.

David
 
Either of your examples will work. You don't have to specify the .Form
property of the subform control, but it certainly won't hurt if you do. From
within the form that contains the subform control you could shorten the code
by replacing "Forms!FormName" with "Me", but again, you don't have to.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
The reason I asked is because I was getting "Error -2147417848: Method
'Requery' of object '_SubForm' failed" error message.

David
 
We'll probably need more information about the code, the record sources of
the main and sub forms, and the relationship between them (link master and
link child fields) in order to help with that.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top