Subform won't requery in VBA. Shift + F9 works after form opens

  • Thread starter Bill R via AccessMonster.com
  • Start date
B

Bill R via AccessMonster.com

I have a subform, sfrmMktData, that is requeried in the Current event of the
main form:

Me!sfrmMktData.Form.Requery

But when the form opens, the subform has not been requeried. Shift + F9
successfully accomplishes the requery.

Any suggestions?

Bill

--
Bill Reed

"If you can't laugh at yoursel, laugh at somebody else"

Message posted via AccessMonster.com
 
B

Bill R via AccessMonster.com

Yes, they are linked on valid Child and Parent ids
the subform records are *not* linked to records in the main form?
I have a subform, sfrmMktData, that is requeried in the Current event of the
main form:
[quoted text clipped - 7 lines]

--
Bill Reed

"If you can't laugh at yoursel, laugh at somebody else"

Message posted via AccessMonster.com
 
T

tina

okay. what goal are you trying to achieve with a requery of the subform as
you move from one record to another in the main form?


Bill R via AccessMonster.com said:
Yes, they are linked on valid Child and Parent ids
the subform records are *not* linked to records in the main form?
I have a subform, sfrmMktData, that is requeried in the Current event of the
main form:
[quoted text clipped - 7 lines]

--
Bill Reed

"If you can't laugh at yoursel, laugh at somebody else"

Message posted via AccessMonster.com
 
B

Bill R via AccessMonster.com

The problem occurs when new values are calculated for the subform. Even
though the subform is requeried in code, as described above, the continuous
subform in question displays one record with "#error" in one of the controls.
When I put my cursor in the subform and hit "Shift+F9", the subform
requeries properly and displays the data correctly.
okay. what goal are you trying to achieve with a requery of the subform as
you move from one record to another in the main form?
Yes, they are linked on valid Child and Parent ids
[quoted text clipped - 5 lines]

--
Bill Reed

"If you can't laugh at yoursel, laugh at somebody else"

Message posted via AccessMonster.com
 
T

tina

well, when a mainform/subform are linked properly, the subform is
essentially "requeried" each time the user navigates to a different record
in the main form, so i don't really understand why an additional requery is
needed at all. but be that as it may, it's strange that only one record in a
continuous form would show an error in a calculated control that "fixes"
itself on a requery of the subform. you've got me stumped, Bill, sorry i
wasn't able to help.


Bill R via AccessMonster.com said:
The problem occurs when new values are calculated for the subform. Even
though the subform is requeried in code, as described above, the continuous
subform in question displays one record with "#error" in one of the controls.
When I put my cursor in the subform and hit "Shift+F9", the subform
requeries properly and displays the data correctly.
okay. what goal are you trying to achieve with a requery of the subform as
you move from one record to another in the main form?
Yes, they are linked on valid Child and Parent ids
[quoted text clipped - 5 lines]

--
Bill Reed

"If you can't laugh at yoursel, laugh at somebody else"

Message posted via AccessMonster.com
 
B

Bill R via AccessMonster.com

Thanks for your effort

Bill
well, when a mainform/subform are linked properly, the subform is
essentially "requeried" each time the user navigates to a different record
in the main form, so i don't really understand why an additional requery is
needed at all. but be that as it may, it's strange that only one record in a
continuous form would show an error in a calculated control that "fixes"
itself on a requery of the subform. you've got me stumped, Bill, sorry i
wasn't able to help.
The problem occurs when new values are calculated for the subform. Even
though the subform is requeried in code, as described above, the continuous
[quoted text clipped - 10 lines]

--
Bill Reed

"If you can't laugh at yoursel, laugh at somebody else"

Message posted via AccessMonster.com
 

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