Results 1 to 4 of 4

Thread: I need HELP!

  1. #1
    Join Date
    Mar 2004

    Unanswered: I need HELP!

    I have a pretty simple question that probably has a pretty simple answer but I am still fairly inexperienced in Access so bear with me I'm more of a VB guy and Access has a little different twist but I do love it. now on to my question.....

    I am writing an application and several of the forms require the user to enter various date ranges to search for the data based on when the data was entered. For instance, the user will enter a date from 01/01/04 to 06/01/04 and all the records that fall between those two dates will be reported. How do I write the program to where the user enters these two dates into an Unbound text box and then get the query to read this information directly from the text box?

    Thank you for any information you can give me

  2. #2
    Join Date
    Jun 2004
    in the criteria of your field in your query:


    Your form needs to be open and the focus cannot be in your textbox at the time you run your query.

    You can also return all records by checking if your textbox is null.


  3. #3
    Join Date
    Nov 2003
    Sussex, England

    Simple solution - not too easy to explain

    Create a module.
    Set up Private variables to hold dates.
    Set up Public Subs and Functions to capture and return the date values


    Module Temp

    Option Explicit

    Private StartDate as date
    Private EndDate as Date

    Public Sub set_StartDate(DateIn as Date)
    StartDate =DateIn
    End Sub

    Public Function get_StartDate() AS Date
    End Function


    You'll need something similar for the other date in the same module.

    On the form Put a button. The code behind the button should look something like:


    In the query:

    Where qryDate Between get_StartDate() AND get_EndDate()

    You will probably need a lot more code to validate and etc, but that's the general idea.

  4. #4
    Join Date
    Mar 2004

    RE:I Need Help!

    Thank you guys. It works great Isn't always those little things that get ya? The help was much appreciated

Posting Permissions

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