473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
1 2516
Stewart Ross
2,545 Expert Mod 2GB
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

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

Similar topics

2
by: Chicken Kebab Abdullah | last post by:
Does anyone know why I get the error 3464 Data type mismatch from the following code. I have a form with a combo(to choose a consumable) and 2 list boxes on it. list on left is all printers...
1
by: ArcadeJr | last post by:
Good morning all! I have been getting a Run-time Error message #3464 - Data Type mismatch in criteria expression. While trying to run a query. I have a database where the field Asset_Number...
2
by: technocraze | last post by:
Hi guys, Implementations application & programming environ MS Acess + Visual Basic Table fields Serialno (pk) - Auto number StudentId - text Course - text intake - number
10
by: aaronrm | last post by:
I have a real simple cross-tab query that I am trying to sum on as the action but I am getting the "data type mismatch criteria expression" error. About three queries up the food chain from this...
1
by: DC | last post by:
Any idea why this code would cause a error? The SQL that gets executed seems to be (using record 1132 as an example) DELETE FROM user_table WHERE ID = '1132'; And the value of...
0
by: bluepiper | last post by:
Hi everyone. I have created a linked server on SQL Server 2005 to access data from visual foxpro database. I execute a query Select * from OpenQuery(members, 'Select * from memfile') but Im...
2
by: CCHDGeek | last post by:
I created a database with a separate front-end that is installed on each computer and linked to a back-end server. After installing the file on several computers, I realized I was getting this...
2
by: tmoon3 | last post by:
Hello, This must be a simple mistake, but for some reason I cannot seem to get around it. I am simply trying to create a report of all employees that have a date filled in in a training column...
5
AAPWM
by: AAPWM | last post by:
Hello My job is to extract data from my companies database with Crystal Reports, export that data to Excel, modify the data, save the data as "Text "tab delimited"", and upload to the database...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.