Parameter query for a combo box using form field only works first

G

Guest

I have a combo box with a query as data source. The query uses a parameter
that is also a combo box on the same form.
When I first open the form the query works fine using the ap[pripriate value
from the combo box above, but when I subsequently change the parameter combo
box and then retry to populate the combo box with the query it's not pulling
in the new parameter value - do I need to refresh the form somehow? How could
I do that?

This is the record source for my combo box:

SELECT tblUWLookup.Underwriter
FROM tblUWLookup
WHERE (((tblUWLookup.Region)=[Forms]![frmPolicyInfo]![Region]))
ORDER BY tblUWLookup.Underwriter;


JHM
 
S

Stuart McCall

JHM said:
I have a combo box with a query as data source. The query uses a parameter
that is also a combo box on the same form.
When I first open the form the query works fine using the ap[pripriate
value
from the combo box above, but when I subsequently change the parameter
combo
box and then retry to populate the combo box with the query it's not
pulling
in the new parameter value - do I need to refresh the form somehow? How
could
I do that?

This is the record source for my combo box:

SELECT tblUWLookup.Underwriter
FROM tblUWLookup
WHERE (((tblUWLookup.Region)=[Forms]![frmPolicyInfo]![Region]))
ORDER BY tblUWLookup.Underwriter;


JHM

The combo based on the query is what needs to be refreshed. Say it's called
Combo1 :

Me.Combo1.ReQuery
 
G

Guest

Oh, thanks, that makes sense, should this code be a 'before update' event of
the combo that has the query?
--
JHM


Stuart McCall said:
JHM said:
I have a combo box with a query as data source. The query uses a parameter
that is also a combo box on the same form.
When I first open the form the query works fine using the ap[pripriate
value
from the combo box above, but when I subsequently change the parameter
combo
box and then retry to populate the combo box with the query it's not
pulling
in the new parameter value - do I need to refresh the form somehow? How
could
I do that?

This is the record source for my combo box:

SELECT tblUWLookup.Underwriter
FROM tblUWLookup
WHERE (((tblUWLookup.Region)=[Forms]![frmPolicyInfo]![Region]))
ORDER BY tblUWLookup.Underwriter;


JHM

The combo based on the query is what needs to be refreshed. Say it's called
Combo1 :

Me.Combo1.ReQuery
 
S

Stuart McCall

JHM said:
Oh, thanks, that makes sense, should this code be a 'before update' event
of
the combo that has the query?
--
JHM


Stuart McCall said:
JHM said:
I have a combo box with a query as data source. The query uses a
parameter
that is also a combo box on the same form.
When I first open the form the query works fine using the ap[pripriate
value
from the combo box above, but when I subsequently change the parameter
combo
box and then retry to populate the combo box with the query it's not
pulling
in the new parameter value - do I need to refresh the form somehow? How
could
I do that?

This is the record source for my combo box:

SELECT tblUWLookup.Underwriter
FROM tblUWLookup
WHERE (((tblUWLookup.Region)=[Forms]![frmPolicyInfo]![Region]))
ORDER BY tblUWLookup.Underwriter;


JHM

The combo based on the query is what needs to be refreshed. Say it's
called
Combo1 :

Me.Combo1.ReQuery

No, use the AfterUpdate event of the parameter combo. Sorry, I should have
mentioned that in my previous.
 

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