Main form not refreshing...

J

John Keith

I have a table that contains student data each with a parent mailing addresses.
One of the fields in this table identifies a house-hold (can group multiple
students)

The data across a household is maintained in a mainframe system and this
data can be stale. The assumption I have been asked to use is to select the
youngest student's parent names and mailing address as the most correct.

I have designed a complex form where the main form uses a query that returns
only the youngest student data to display the parents and mailing address.

A sub-form uses the house-hold identifier as a filter to show all the
student(s) data from the main-table. The yougest is flagged with a large
mail-box icon to draw the users attention to the row in the sub-form that
will be used for generating the mailing address. The sub-form is editable to
allow the user to make changes to this data. As a change is made, the main
table is updated. If that change is made to the youngest student, then the
main-form show refresh to show the new change... But this is not happening.

The main form has the navigation tool, and when using it to scroll through
records all the correct data is displayed on both main and sub forms.

A third form (a pop-up search) allows filtered searches to show in it's
detail section and when a row is clicked, the popup goes away and the
house-hold id is populated back to the main-form's control. When this
happens, the sub-form is refreshed to show the matching house-hold. The
main-form still shows what ever data was on the screen prior to selecting the
new house-hold.

I have tried putting event code for Before_Update in the main forms
house-hold-id field to make the other fields point to the matching row but
the event never fires. (stop statement never, stops the code)

How do I make the main-form's(query data) automatically refresh using the
new-house-hold key that was just placed on the form? Another event? Maybe I
need to force this to a filter?
 
N

Nicholas Scarpinato

When executing the code for your search from the popup, include the line

Forms!Main.Requery

to requery the main form based on the new data.
 
J

John Keith

That worked!

But it pointed out a problem, the load time of running the query is too long
to dynamically call it each time the viewed key changes. Initially as the
form is first launched the longer load time is acceptable, but while
navigating the form its just too long.

Is there a way to utilize the query result set that is stored upon initial
load to reposition the current record pointer with out having to requery?
 
N

Nicholas Scarpinato

I'm not sure how you have your queries written... but if you could show me a
sample of the code, I might be able to help you narrow down what's causing
the performance issues.
 

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