Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Posts
    2

    Unanswered: OpenReport and Multiple Expressions

    I'm a newbie to to Access so please bear with me.

    I'm creating a Project Mangement db in Access 2K2 for work; part of which is a timesheet recording function. Anyway, I'm trying to create a report based on a specified date range and employeeID. The "[EmployeeID]=" &[EmployeeID] works alone and the [DateWorked] blah... also works alone. But when i try to combine them I get "Run-Time error '13' Type Mismatch"

    DoCmd.OpenReport "TimeSheets", acPreview, , "[EmployeeID]=" & [EmployeeID] And "[DateWorked] Between #" & Format(Me.StartDate, "mm\/dd\/yyyy") & "# And #" & Format(Me.EndDate, "mm\/dd\/yyyy") & "#"

    Any suggestions would be greatly appreciated!

    Thanks in advance,
    Mike Basden

  2. #2
    Join Date
    Oct 2001
    Location
    Bay Area, CA
    Posts
    117
    try this

    DoCmd.OpenReport "TimeSheets", acPreview, , "[EmployeeID]=" & [EmployeeID] And "[DateWorked] >= #" & Format(Me.StartDate, "mm\/dd\/yyyy") & "# And [DateWorked] <= #" & Format(Me.EndDate, "mm\/dd\/yyyy") & "#"

    hope this helps...

  3. #3
    Join Date
    Apr 2002
    Posts
    2
    Thanks for the reply, but it still comes back with the Type Mismatch.

    Any other suggestions?

Posting Permissions

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