Results 1 to 5 of 5

Thread: Data Question

  1. #1
    Join Date
    Mar 2004
    Posts
    51

    Unanswered: Data Question

    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
    Location
    Florida, US
    Posts
    521
    in your query designer, right click in the criteria section of the field, choose "Build...". choose forms then go through forms till you find your date textbox is listed on the middle pane. double click the textbox then click OK. now it should be in the criteria section.
    ofcourse you should use BETWEEN operator to make your query work in this case like:
    Code:
     BETWEEN Forms![DlgPrograms]![txtDate1] AND Forms![DlgPrograms]![txtDate2]
    ghozy.

  3. #3
    Join Date
    Sep 2004
    Location
    Kuala Lumpur
    Posts
    60
    I would just add (plz correct me if I'm wrong) that BETWEEN is actually INclusive.

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    thats true wazz. function includes the dates you used as parameter.
    ghozy.

  5. #5
    Join Date
    Mar 2004
    Posts
    51
    thank you guys. i knew about BETWEEN but i was having a hard time with the syntax of reading values directly out of the text boxes and this works GREAT so thanks a lot greatly 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
  •