Results 1 to 2 of 2
  1. #1
    data808 is offline Noob
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    727

    VBA on split form for start and end date filter

    Can anyone please help me create a VBA to do a start and end date filter?



    The idea I had was to create two unbound text boxes. One for the start date and the other for the end date. Then also have a filter button and an undo filter button.

    Can this be done? I know nothing of VBA so there's no real point in trying to give me hints to write the code because I really can't do it. Sorry.

    Thanks for the help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Techniques referenced on other thread can be used https://www.accessforums.net/forms/v...ing-41238.html

    Doesn't matter which method you use, some code will be required.

    If you don't want to use Allen Brown's coded approach, the alternative is a dynamic parameterized query, example also already referenced.

    However, data ranges are a bit more complicated. Try something like:

    SELECT * FROM tablename WHERE initials LIKE "*" & Forms!formname!txtInitials & "*" AND [Permit Number] LIKE "*" & Forms!formname!txtPermit & "*" AND [date field] BETWEEN Nz(Forms!formname!txtStart,1/1/1900) AND Nz(Forms!formname!txtEnd,12/31/2900);
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-02-2013, 01:59 PM
  2. Filter Split Form using ListBox and .ME
    By clchris_80 in forum Access
    Replies: 3
    Last Post: 01-17-2013, 07:30 PM
  3. multiiple filter on a split form
    By webisti in forum Forms
    Replies: 1
    Last Post: 04-06-2012, 12:36 PM
  4. Filter or FindRecord in Split Form
    By P5C768 in forum Forms
    Replies: 4
    Last Post: 03-20-2012, 12:16 PM
  5. Replies: 1
    Last Post: 07-07-2010, 04:22 PM

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