Results 1 to 2 of 2
  1. #1
    hithere is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Sep 2011
    Posts
    63

    Filter form on load

    I am trying to open a form where one of three dates cannot be null.



    The form name is Review. I have the following code written in the button on another. Do.cmd.openform "Review",,, Date1 <> "" AND Date2 <> "" AND Date3 <> """ but this is not working. Is there any reason why? If this can be done if the filter properties of the Review form that would be great, I just can't seem to find an example anywhere.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    If you always want it filtered, I'd base the form on a query with the appropriate criteria. In your case, there are a couple of problems If you really want to test for "", it would be:
    Code:
    Docmd.openform "Review",,, "Date1 <> '' AND Date2 <> '' AND Date3 <> ''"
    If that's a date field, you probably want to test for Null:

    Code:
    Docmd.openform "Review",,, "Date1 Is Not Null AND Date2 Is Not Null AND Date3 Is Not Null"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Getting Form to Filter Records On Load
    By Dclassen89 in forum Forms
    Replies: 12
    Last Post: 02-01-2014, 07:39 PM
  2. Replies: 8
    Last Post: 07-27-2012, 12:23 PM
  3. Filter a control on load
    By nick.h in forum Forms
    Replies: 1
    Last Post: 12-01-2011, 02:46 AM
  4. filter records to populate form on load
    By rivereridanus in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 08:54 AM
  5. Form - Filter on load (if data exists)
    By dilbert in forum Forms
    Replies: 0
    Last Post: 08-13-2010, 11:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums