Updating A Subform

  • Thread starter Thread starter Phantom_guitarist
  • Start date Start date
P

Phantom_guitarist

Just a quick question on a problem I'm stuck with on access.

What I have

table 1 : Contains Expense Receipts
table 2 : Generated by Quey1
table 3 : List of Categories

Query 1 : Takes table 1 and groups it according to table 3 saving the
results in Table 2(make table query)
Query 2 : Only selecting items from table 1 within a certain date

Form 1 : Consist of a tab control with 3 pages.
Page 1 : Has boxs wherre you can add new data to form 1. When table is
changed query 1 is run.
Page 2 : Shows Query 2
Page 3 : Displays form 3 allowing you to edit and add. When table is
changed query 1 is run.

The problem is when I change categories on page 3 or add a new item on page
1 of the form. Page 2 doesn't display the changes. What I need to know is
how to update/refresh the subform on page 2 (which refers to query 2).

Hope that made sense.

Stef
 
The problem is when I change categories on page 3 or add a new item on page
1 of the form. Page 2 doesn't display the changes. What I need to know is
how to update/refresh the subform on page 2 (which refers to query 2).

You could "Requery" the subform on Page 2 from within the code (in each of the
subforms on pages 1 and 3) that runs Query1. To requery the subform on Page 2
from the other subforms, try using this syntax:

Me.Parent.SubformControlName.Form.Requery

Replace "SubformControlName" with the name of the subform *control* on Page 2,
not the name of the subform itself (although they both may share the same name).
 
Your advice
on "Me.Parent.SubformControlName.Form.Requery" worked for
me but the problem is that even if I use "Refresh" it
still does a "Requery." In other words, it won't keep
the users place on the form (i.e. the record won't remain
selected.)

Background: A main form with a tab control within a tab
control (lots of info to display) that opens a detail
form. I'm trying to get updates on the detail form to
refresh on the main form. Not working - acting as stated
above.

Any advice would be greatly appreciated!

Thanks,
Ed Wiancko
 
Back
Top