Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How not show records on a form bound to a table

I have a form which is bound to a table.  Some of the records in the table do not have data in the field named "Description"  If there is nothing in the description field I do not want those records to show in the form (continuous form by default).

I thought I could do it with in the onopen event of the form but this doesn't work:

    Me.Filter = [Description] <> "*"
    Me.FilterOn = True
SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Gus,
That assumes the Description is null.  It may be a ZLS which is indistinguishable visually.  In most cases, I do not allow ZLS in my tables.  They cause nothing but confusion and extra work.  It is only imports from other applications that may include them and only in staging tables.

A common way to get a ZLS in a text field that isn't set to prevent them is via a form.  If the user enters a value in a text field and then changes his mind and uses the backspace to get rid of the typing, a ZLS is saved in the field rather than null.  Access knows the field was dirtied but is now empty so it saves a ZLS.  Of course, you would get an error on save if the table does not allow ZLS.
>  I do not allow ZLS in my tables.

Neither do I, and you have to actively select it. In most cases, if it is allowed, it's by an error.
That's why my filter string should do it; the wording is carefully selected.

/gustav