Refresh after going to next record

juansre

New member
Local time
Today, 06:21
Joined
May 18, 2009
Messages
7
Hi.
I'm getting mad triying to solve this "little" issue, altough I've been for a long time looking for a solution.
The thing is that i've got a main form with 2 subforms, wich takes the values from a query and two comboboxes in the form. When I navigate trough the records of the main table (in the main form), the values of that comboboxes changes, but It didn't the subforms ones.
The thing is when i press the refresh button it load the right values, but before that records on the subs keep empty.
Sorry for the poor explanation, is the better I could. I attach the example database so anyone can help me!!
I tried by VBA code (Me.subforms.refresh, requery...) and nothing works.
Thanks in advance for your help.
 

Attachments

You haven't mentioned what the names of the combo boxes are?

Can you also explain how to replicate the problem?
 
First of all, thanks for the interest.

Ok, let's explain a little better.
There's 1 Main form (frmCopia) and 2 SubForms ("subformulario qryAlineac1" and "Subformulario qryAlineac2"). They are both linked with the Main form by 2 parameters: "IdEqL" for "subformulario qryAlineac1" and "IdEqV" for "Subformulario qryAlineac2".
The subForms takes their values by a query (qryAlineac1 and qryAlineac2), where the value of IdEq is [Forms]![frmCopia]![IdEqL] (for Alineac1) or [Forms]![frmCopia]![IdEqV] (for Alineac2).
The thing is when the form is load, it takes the values of IdEqL/IdEqV for the first record of the forms.
What I'm trying to do is to refresh the query each time I go to another record. I can do that manually with the refresh button just after selecting the subforms.

Hope I have explained myself better this time.
 
Ok, I see what you mean.

Change the settings as below.

subformulario qryAlineac1:
Link Master Fields - IdPart;IdEqL
Link Child Fields - IdPart;IdEq

Subformulario qryAlineac2:
Link Master Fields - IdPart;IdEqV
Link Child Fields - IdPart;IdEq

Once you've done that, go into your qryAlineac1 and qryAlineac2 queries and remove the [Forms]![frmCopia]![IdEqL] criteria.
 
I've done it, and works fine. I've had to made changes in the comboboxes as they was filtered also by [Forms]![frmCopia]![IdEqL] and [Forms]![frmCopia]![IdEqV].
Thanks for your help, this thing has been making me crazy for a long time, and you solved it in a while.
 

Users who are viewing this thread

Back
Top Bottom