Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Location
    Black Hills of South Dakota
    Posts
    7

    Unanswered: Please Help...User specified data query

    I am at a loss on how to create a query that will take a user specified date range using a calendar object in a form.

    Thanks in advance

    C.

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    I would put a text feild on the form and


    Then in the Event of clicking the Buttom

    Private Sub Command3_Click()
    Me.Text1 = Me.MonthView0.Value
    DoCmd.OpenQuery "bla"
    End Sub

    but the bla query is pointing to the me.text1


    What I do is OPen the Form in Design mode

    Open Query in Design mode then

    Right Click the Criteria where you want to full in

    click the build ...

    2x click the forms
    2x click the Loaded Forms
    1 click the form you want
    2x the feildname
    click ok

    Done beats the typing it in and getting it wrong
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Aug 2006
    Location
    Black Hills of South Dakota
    Posts
    7
    Thanks for help.
    Definitely clear as mud.
    I have kind of worked this out.
    My criteria is BETWEEN [Start Date] AND [End Date]
    I run the query and it returns dataset.Perfect.
    Now I am unsure on your clicks on how to build my query into a form to i then insert into existing switchboard.

    P.S. My vb skills are NULL.

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    Hi

    So your query say something like

    Between [form!name]![start date] And [form!name]![end date]

    can't rem the [ ! ] the order

    Then If You have A report/form pointing to that Query then

    Then When you open the Report

    The report Looks @ the query then That Query Looks @ the Form calendar object
    Query get run then The Report show you the info.
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  5. #5
    Join Date
    Aug 2006
    Location
    Black Hills of South Dakota
    Posts
    7
    No i did not use the...
    Between [form!name]![start date] And [form!name]![end date]
    I will try.
    Thanks

  6. #6
    Join Date
    Aug 2006
    Location
    Black Hills of South Dakota
    Posts
    7
    Error
    Invalid bracketing of name [form!name]![start date]

  7. #7
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7
    Between [Forms]![Reportit]![start_date] And [Forms]![Reportit]![end_date]


    Between Form call Reportit and the feild start_date And Form call Reportit and the feild end_date
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Report query

    You can try looking at the sourceobject query on the report in this attached example. It might help you.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Another Calendar Example

    Here's another calendar example for popping up a calender and putting a date on the form (I wasn't sure if the last one included that or not.)
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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