By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,154 Members | 2,405 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,154 IT Pros & Developers. It's quick & easy.

Run Time error : 3464 ( Data Type Missmatch in criteria expression)

P: 1
Dears,
I have a table named Tasks that Contains all the Information about my employee , i am making a Form to open a report based on Employee Name, Tasks done, Date.
but i'm getting error with this code
can u help me figure out where is my error plz

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command20_Click()
  2. Dim sFilter As String
  3. sFilter = ""
  4.  
  5. If Me.Name.ListIndex <> -1 Then
  6.     If sFilter = "" Then
  7.         sFilter = "[Assigned To]= " & Me.Name & ""
  8.         Else
  9.         sFilter = sFilter & " And [Assigned To]=" & Me.Name & ""
  10.     End If
  11. End If
  12.  
  13. If Me.Task.ListIndex <> -1 Then
  14.     If sFilter = "" Then
  15.         sFilter = "[Title]= '" & Me.Task & "'"
  16.         Else
  17.         sFilter = sFilter & " And [Title]='" & Me.Task & "'"
  18.     End If
  19. End If
  20.  
  21.  If Format(Me.Dates, "MM/DD/YYYY") <> -1 Then
  22.     If sFilter = "" Then
  23.         sFilter = "[Date]= '" & Format(Me.Dates, "MM/DD/YYYY") & "'"
  24.         Else
  25.         sFilter = sFilter & " And [Date]='" & Format(Me.Dates, "MM/DD/YYYY") & "'"
  26.     End If
  27. End If
  28.  
  29. DoCmd.OpenReport "Agent Total Hour", acViewPreview, , sFilter
  30.  
  31. End Sub

NB: if i need to set a range so i can choose between 2 dates what would i do plz

Thanks in advance.
Elie Nakhle.
Sep 29 '08 #1
Share this Question
Share on Google+
1 Reply


Expert Mod 2.5K+
P: 2,545
Hi. Rather than have us guess what your error is and where it is occurring, please tell us the line number (referred to the code-tagged line numbers now shown in post 1 above) and the exact nature of the error that occurs.

I would also ask you not to use phone-text abbreviations in your posts, as many readers will not be able to work out what these mean.

Thank you.

-Stewart
Sep 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.