refreshing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My data doesnot refresh on the display unless I quit several subform levels
and go back down again. I thin kthe problem might have to do with the forms
are based on Queries.

I tried puting fieldname.requery in the LOSTFOCUS of the lowest sublevel, I
tried putting a command button on the form I want the data to refresh on and
using the wizard form operations-refresh data.
I apparently don't understand the basics of what is going on.

Generally:
Table1
Table2
Table3
form1 based on a query pulling from all 3 tables
subform1 based on table2
if I change data in table 2 using subform1
how do I refresh the data on form1?

thanks
 
mark said:
My data doesnot refresh on the display unless I quit several subform levels
and go back down again. I thin kthe problem might have to do with the forms
are based on Queries.

I tried puting fieldname.requery in the LOSTFOCUS of the lowest sublevel, I
tried putting a command button on the form I want the data to refresh on and
using the wizard form operations-refresh data.
I apparently don't understand the basics of what is going on.

Generally:
Table1
Table2
Table3
form1 based on a query pulling from all 3 tables
subform1 based on table2
if I change data in table 2 using subform1
how do I refresh the data on form1?


Not sure I followed that, but I think you want the subform's
AfterUpdate event procedure to include the line:

Parent.Requery
 
Form1 is based on a query that pulls data from three tables, so I cannot
update datafields on form1. So I have three buttons that open "subforms"
which are based on one single of the three tables underlying the query for
form1. There, I can change datafields directly to the tables.

But when I close those subforms, form 1 still shows old values. If I go to
the menu and click RECORDS-REFRESH, that does not refresh the display
either.....I guess the query which underlies the form1 is not rerun.

is parent.requery what I want and where do I put it?
 
Form1 is based on a query that pulls data from three tables, so I cannot
update datafields on form1. So I have three buttons that open "subforms"
which are based on one single of the three tables underlying the query for
form1. There, I can change datafields directly to the tables.

These are not *subforms* unless they are in Subform controls on your
main form. If you're opening them with button code, then they are
standalone forms in their own right, NOT subforms. Marshall was taking
your question literally; a Subform has a Parent, but a standalone form
does not.
But when I close those subforms, form 1 still shows old values. If I go to
the menu and click RECORDS-REFRESH, that does not refresh the display
either.....I guess the query which underlies the form1 is not rerun.

Correct. Refresh just checks to see if someone else on the network has
updated the tables referenced in the Form's Query.
is parent.requery what I want and where do I put it?

Use instead

[Forms]![yourformname].Requery

and put it in the AfterUpdate event of each of your three pop-up
forms.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
John,

Thanks. Let me make sure I understand correctly.
Use instead

[Forms]![form1_based_on_a_query].Requery

and put it in the AfterUpdate event of each of your three pop-up
forms.

will have the effect of "re-running" the query after I leave the pop-up
forms so that when I return to the form1, the data on it will reflect
changes executed on the pop-up forms....is this correct?
 
mark said:
John,

Thanks. Let me make sure I understand correctly.
Use instead

[Forms]![form1_based_on_a_query].Requery

and put it in the AfterUpdate event of each of your three pop-up
forms.

will have the effect of "re-running" the query after I leave the pop-up
forms so that when I return to the form1, the data on it will reflect
changes executed on the pop-up forms....is this correct?


Yes, that's what Requery does. It will re-run the query
every time you update (add or change) a record in the second
form, not just when it closes. You only needed to properly
identify the form object that you wanted to requery.
 
Back
Top