Access2000: Setting a filter to a subform

A

Arvi Laanemets

Hi

I have an unbound form fmMain. On this form I have some combo boxes
(cbbAGroup, cbbAStatus, cbbAStore), and a subform sfAssets, which is based
on form fmAssets.
The source for form fmAsset is a table tblAssets with fields AssetID,
AGroup,...,CurrStatus, CurrStore, ... etc.
For subform sfAssets is defined the link cbbAGroup-->Agroup, i.e. the
subform always displays assets of the single group, determined by combo on
fmMain.

Now 2 other combos must determine a filter condition for form fmAssets. The
filter condition will be (in simplified form, not the real formula)
Iif(cbbAStatus=0,"CurrStatus<>9","CurrStatus=" & cbbAStatus) &
Iif(cbbAStore=0,""," And CurrStore=" & cbbAStore)

It all works (right records according the set filter condition are
displayed), except that whenever I try to test it, I can't close the
application anymore. The only way to close the app is from task manager.

I disabled all code which sets filter conditions - the app closed normally.
I typed the filter condition manually in - the app didn't close. So my quess
is, the link for subform and the filter condition on its form somehow are
interacting.

Can someone here give some advice?


Thanks in advance!
Arvi Laanemets
 
A

Arvi Laanemets

Hi

I did find another solution here. Instead of filtering form source, I
replaced the table in RowSource with a guery, and edit now the RowSource
whenever cbbAStatus or cbbAStore change.

Arvi Laanemets
 

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