Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2012
    Posts
    85

    Unanswered: Query Start Date/End Date

    hey,
    I have created a query to give me the name, returndate, and return based on a start date and end date.
    Between [Enter the start date:] And [Enter the ending date:]
    Now i have created a form with the popupcalendar to select the start date and end date. I have the query open up in my form now how is it possible to create data from the search? I have called the text boxes txtStartDate and txtEndDate respectively.

    I tried this:
    Between [froms!search.forms!txtStartDate] And [froms!search.forms!txtEndDate]
    But it doesnt work, i want to just parameterize the query, if anyone has any idea please let me know,
    thanks,
    Mike
    ________

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Code:
    With YourQueryNameHere
        .Parameters("Enter the start date") = Me.txtStartDate
        .Parameters("Enter the ending date") = Me.txtEndDate
        .Execute
    End With
    This will work if you have an Action query (make-table, append, delete, or update). If you have a select query, it's a bit different.

    Sam

  3. #3
    Join Date
    Jun 2012
    Posts
    85
    I have a select query, ill try and manipulate it more, thanks for the input!
    Mike
    ________

  4. #4
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Dim rst As Dao.Recordset

    Code:
    With "YourQueryNameHere in quotes"
        .Parameters("Enter the start date") = Me.txtStartDate
        .Parameters("Enter the ending date") = Me.txtEndDate
        Set rst = .OpenRecordset(dbOpenDynaset)
    End With
    You can then access the new recordset (rst) with VBA.

    Sam

Posting Permissions

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