DoCmd.ApplyFilter Causes Form to Go Blank

MCCDOM

Registered User.
Local time
Today, 21:01
Joined
Oct 30, 2014
Messages
84
Hi There,

I have a form that uses a combobox to filter by name to then show the relevant data in the two textboxes below. Now for some reason when I search for the name of the first record it shows the information fine but if I search for any other name it causes the entire form to go blank except for leaving the label in the Form Header present, but all controls on the form disappear. The combobox (cboNameLookup) is unbound and uses a RowSource query. The two textboxes are bound to the Control Source based on the Forms Record Source Query.
Could someone help me please get this working correctly?

Kind regards,

Dom
 
This is caused when a Form recordset has no records!
 
This is caused when a Form recordset has no records!

And when no Records can be added...for whatever reason!

If you open the ' Forms Record Source Query' independently, can you add a Record to it, or is it Read-Only?

Linq ;0)>
 
...it causes the entire form to go blank except for leaving the label in the Form Header present, but all controls on the form disappear...

I assumed, from the above, that the OP means that the Controls themselves (in the Detail Section) disappear, as opposed to the Controls all being blank...as it would if the Recordset was simply empty.

Actually there's three conditions that must all be present for this phenomenon to occur:

  • The Form is Bound to a Table or Query
  • There are No Records in the underlying Recordset or the Recordset cannot be accessed
  • The Form cannot have New Records added (which can have any number of reasons)
Linq ;0)>
 
A closely related bug is discussed in this thread.

The solution to that one is to put the results into a subform and move the search box to the main form. It might work for your issue too.
 
Hi all,

Thank you very much for all your help and suggestions. I have taken on board what you have said and have pin pointed what was wrong. I didn't have enough records in the one table (tblKeys) to be paired with a nameID from the name table (tblName). I thought I could get away with a few records for testing purposes. Apparently not so I have filled out the tblKeys so that every name from tblName has a record associated in tblKeys via the nameID foreign key.

Thanks again,

Dom
 

Users who are viewing this thread

Back
Top Bottom