Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Posts
    65

    Question Unanswered: Searching for empty fields

    I am having troubles with that simple issue. On my form I have 3 combo boxes and I am filtering the records according to the selections of each combo box. It works fine.

    However, I have also two check boxes. If CheckBox1 is set to Yes, I want to further filter the records by selecting only customers who have e-mail addresses. I am trying to accomplish this by simply adding another condition to the sql string for the RecordSource. This works fine too.

    My CheckBox2 (if set to Yes) should filter only customers with NO e-mail addresses. And this is the problem.

    I am doing this:

    strRecSource = " something"
    .
    .

    if me.CheckBox2 = Yes then
    strRecSource = strRecSource & _
    " AND Customer.Email = ''"

    This will compile and run and return zero records. I am doing something wrong when referencing the empty field.

    Any help would be highly appreciated.

    Jazz

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Take your pick:

    IsNull(Customer.Email)

    Customer.Email Is Null

    Customer.Email & ''=''
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Feb 2003
    Posts
    65

    Smile

    Thanks M Owen! Works like a charm.

    Jazz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •