Results 1 to 4 of 4
  1. #1
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60

    Apply Filter based on unbound date boxes

    I have a form that shows all my records from a table. I am trying to create a macro that allows me to quickly show transactions between a start and end date when I click a button. This is not for a report, just quick viewing.

    (This is a trial database, spaces in field names and such will be removed on actual build.)

    Right now I have an ApplyFilter action with the following arguments:

    Code:
    [Transaction Date] Between [StartDateComboBox] And [EndDateComboBox]
    Transaction Date = date each record was entered in table, stored value.
    StartDateComboBox = Unbound date field in my footer.
    EndDateComboBox = Unbound date field in my footer.

    When I run the macro I am prompted (alert style box) to enter the values for both unbound text fields, even when I enter them in the footer BEFORE I run the macro. When I enter them manually in the prompts the macro runs properly, but my question is this:

    Is there something I am missing in my arguments that would prevent the macro from using the current values in these unbound fields? Can I add something that makes it pull and use the values automatically, without prompting me? For example:

    [StartDateComboBox].CurrentValue


    Or something similar?
    If it helps the macro runs when I click a button that says "Show Range" to the right of the unbound date fields, it doesn't run automatically.

    Sorry if my terminology is off, I'm very new...
    Any help would be greatly appreciated!
    Thanks.

  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,521
    I don't use macros, but try

    [Transaction Date] Between Forms!FormName.[StartDateComboBox] And Forms!FormName.[EndDateComboBox]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60
    It worked!
    Thank you so much.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Ah good, glad it worked for you.
    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. Replies: 5
    Last Post: 10-06-2010, 07:28 PM
  2. Filter by Form: Check Boxes.
    By tbh7x in forum Forms
    Replies: 0
    Last Post: 08-18-2010, 09:15 AM
  3. Apply filter command
    By miziri in forum Forms
    Replies: 6
    Last Post: 01-21-2010, 02:22 AM
  4. Use unbound boxes in a form
    By jjerome512 in forum Forms
    Replies: 2
    Last Post: 01-14-2010, 08:53 PM
  5. Replies: 1
    Last Post: 03-01-2009, 09:53 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