fields disappear if filter results in no matching records

  • Thread starter Thread starter micki
  • Start date Start date
M

micki

I have a tab control page with a subform - want to turn on
the filter but NOT allow additions/deletions.
When I set filterOn to true and set the filter - the form
dissappears if there are no matching records.
If I allowAdditions then the form appears as expected.
When I remove the filter the form appears as extected.

I can code to query before the filter is activated but I'd
rather not have another delay in the response...

Can anyone tell me what setting I'm missing/using wrong?
 
You got the correct behaviour: The Detail section of the (Sub)Form will be
blank if AllowAdditions = False & the Recordset is empty.

Checking for RecordCount using a Query before setting the Filter should
affect the delay that much ...
 
I have a tab control page with a subform - want to turn on
the filter but NOT allow additions/deletions.
When I set filterOn to true and set the filter - the form
dissappears if there are no matching records.
If I allowAdditions then the form appears as expected.
When I remove the filter the form appears as extected.

I can code to query before the filter is activated but I'd
rather not have another delay in the response...

Can anyone tell me what setting I'm missing/using wrong?

You're not doing anything wrong. This is normal behavior - a Form
whose recordsource is not updateable will not show the blank "new
record", and if the recordsource is empty it won't show any existing
records either; so you see nothing at all.

You might want to put code in the routine which sets the filter to
check the recordset's RecordCount first - if it's zero, give the user
an appropriate explanation.
 
Back
Top