Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Location
    Tucson Arizona
    Posts
    5

    Question Unanswered: Linking Queries to Calendar Control

    Hi all.
    I have a question regarding queries and the calendar control. Basically I have a two-step process involving a select query and then a cross-tab query that sums the results of the select query across time intervals (and a report eventually gets printed from this). On a form I have a calendar control and I would like the user to be able to select the dates between which they want to view data for the report. I can get this to work just fine linking the [Date] field in the select query to the calendar control by stating this in the criteria:
    Between [Forms]![frmPtsSummaryDatePick]![BeginningDate] And [Forms]![frmPtsSummaryDatePick]![EndingDate]
    However, the report that I eventually want to print is based on a crosstab query that summarizes the results from the above select query, and when I go to run the report/crosstab query I get this message:
    "Runtime error '3070'
    The microsoft Jet database engine does not recognize
    '[Forms]![frmPtsSummaryDatePick]![BeginningDate] And [Forms]![frmPtsSummaryDatePick]![EndingDate]' as a valid field name or expression"
    I can't really understand why the crosstab query won't work since it will work if you type in a criteria for [Date] in the select query as Like 4/*/06
    Does anyone know of a work-around?
    Thanks in advance.
    -melissa

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Crosstab queries require that their parameters be explicitly declared. With the query in design view, Query/Parameters.
    Paul

  3. #3
    Join Date
    Apr 2006
    Location
    Tucson Arizona
    Posts
    5
    Thanks. I tried that, but I am not sure what to declare in the parameter window, so I can't come up with anything that works. Any suggestions?
    -melissa

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    [Forms]![frmPtsSummaryDatePick].[BeginningDate] on the left (parameter) side, presumably Date/Time (it would be the data type of the field in the table) on the right (Data type) side.
    Paul

  5. #5
    Join Date
    Apr 2006
    Location
    Tucson Arizona
    Posts
    5
    Thanks Paul.
    That solved it! That saved many hours of frustration - I never knew that I had to enter in the entire "[Forms]![frmPtsSummaryDatePick].[BeginningDate] " into the parameters - I was trying to enter in [BeginningDate] alone.
    I really appreciate allof your help!
    -melissa
    Last edited by mmerrick; 05-02-06 at 17:14.

Posting Permissions

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