Refresh Subform2 Query when Subform1 Control Changes

P

pcross29

I've got a "MainForm" with a tab control. On one page of the tab
control I have "Subform1" which has a control named "txtBox' tied to a
table. On another page I have another "Subform2" which has inside of
it a "Subform3" that relies on that "txtBox" from "Subform1". I want
to have that "Subform3" (which is based on a query of the table that
"txtBox" updates) refresh when the "txtBox" changes. Here's a visual
and some code that does *not* work. Help Please!

MainForm
--Subform1 > txtBox
--Subform2 -- Subform3

Forms!MainForm!Subform1!Subform2.Form.Requery

This is attached to the txtBox AfterUpdate property. Why won't it
work?

-- Paul C., thanks.
 
R

Richnep

I've got a "MainForm" with a tab control. On one page of the tab
control I have "Subform1" which has a control named "txtBox' tied to a
table. On another page I have another "Subform2" which has inside of
it a "Subform3" that relies on that "txtBox" from "Subform1". I want
to have that "Subform3" (which is based on a query of the table that
"txtBox" updates) refresh when the "txtBox" changes. Here's a visual
and some code that does *not* work. Help Please!

MainForm
--Subform1 > txtBox
--Subform2 -- Subform3

Forms!MainForm!Subform1!Subform2.Form.Requery

This is attached to the txtBox AfterUpdate property. Why won't it
work?

-- Paul C., thanks.

In the properties of the txtbox that will trigger the refresh when the
data changes, goto the onchange event and put in this code:

Me.Refresh

If that doesn't work use Me.Requery
 
P

pcross29

In the properties of the txtbox that will trigger the refresh when the
data changes, goto the onchange event and put in this code:

Me.Refresh

If that doesn't work use Me.Requery- Hide quoted text -

Nah. These didn't work. Wouldn't these just be refreshing the subform
that the textbox sits on? In any case, these didn't work because the
textbox is added to another textbox data entry value to calculate a
third control. As soon as you type one digit that "Refresh" or
"Requery" on the On Change property kicks in and doesn't even allow
you to enter a 2-digit number!

Thanks for looking.
 

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