Combo box activation?

R

RoMi

Access 2002 (mdb saved as 2000).

Problem: Selecting data in a combo box can not activate a query on a
subform. Nothing happens.

Temporary solution: Change to a design view and then immediately return to a
form view. After that all works properly, i.e. combo box correctly filters
the data on a subform.

Design: A command button cmdFilter placed on a switchboard initiates a macro
mcrFilter which opens a form frmDataFilter. There is a combo box cboFilter
on this form which helps user to select a parameter from a table tblDept and
use it to filter the data from a tblData. The results are displayed on a
subform in a datasheet view.

What is missing? What else is needed to activate the query because an
AfterUpdate event in a cboFilter is not enough. This problem happens after
the opening of the form that keeps the cboFilter and a subform.

More specific data or a code needed for better understanding of this
problem?

Thank you

M. Kadija
 
V

Van T. Dinh

Linked Subforms are automatically requeried only when the CurrentRecord on
the linked Main Form is changed. If you have other set-ups, you need to
requery the Subform by code.

If you have a ComboBox on the Main Form that is being used as the
LinkMasterFields for the SubformControl (or the Subform's RecordSource
depends on the selected Value in the ComboBox), then simply use the
AfterUpdate Event of the ComboBox to requery the Subform.

I am not sure of what you are trying to do / describe in "Design:"
paragraph.
 
D

Dale Fye

Does the subform have a master/child relationship to the cboFilter?
If not, it should. An alternate method would be to have the data
source for your subform reference cboFilter. Then, in the AfterUpdate
event of cboFilter, you would need to requery the subform.

--
HTH

Dale Fye


Access 2002 (mdb saved as 2000).

Problem: Selecting data in a combo box can not activate a query on a
subform. Nothing happens.

Temporary solution: Change to a design view and then immediately
return to a
form view. After that all works properly, i.e. combo box correctly
filters
the data on a subform.

Design: A command button cmdFilter placed on a switchboard initiates a
macro
mcrFilter which opens a form frmDataFilter. There is a combo box
cboFilter
on this form which helps user to select a parameter from a table
tblDept and
use it to filter the data from a tblData. The results are displayed on
a
subform in a datasheet view.

What is missing? What else is needed to activate the query because an
AfterUpdate event in a cboFilter is not enough. This problem happens
after
the opening of the form that keeps the cboFilter and a subform.

More specific data or a code needed for better understanding of this
problem?

Thank you

M. Kadija
 
V

Van T. Dinh

Hi Dale

I find that if we use the ComboBox on the Main Form as the LinkMasterFields,
AXP doesn't requery the Subform (unless the ConboBox update changes the
Current Record on the Main Form). In this case in AXP, I leave the Subform
unlinked and simply use code to re-query the Subform.
 

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