Solved

Where condition, datatype mismatch error.

Posted on 2013-12-24
3
341 Views
Last Modified: 2013-12-24
Experts, I get a data type mismatch in the below.  I am sure it is something to do with either the # or the double quote.  

Private Sub cmdOpenRpt_Click()

    Dim strCriteria As String
    
    strCriteria = "([End User] Like '" & Me.[txtClient] & "*' Or [End User] Is Null) AND " _
                       & "[EntryDate]>=#" & Me.[txtdatefrom] & "# And " _
                       & "[EntryDate]<#" & Me.[txtDateTo] + 1 & "# And " _
                       & "[EntryDate] Is Not Null" And "" _
                       & "[SentForSign]>=#" & Me.[txtdatefrom] & "# Or " _
                       & "[SignedDate]>=#" & Me.[txtdatefrom] & "#"
                       
    DoCmd.OpenReport "rptDepartures_other", acViewReport, strCriteria

Open in new window



End Sub
0
Comment
Question by:pdvsa
  • 2
3 Comments
 

Author Comment

by:pdvsa
ID: 39738511
I think it has something to do with line 8.  
There are 2 double quotes and Access put the extra one there after I delete it.  
There could be something else but I think the error is between line 8 and 10
0
 
LVL 10

Accepted Solution

by:
Korbus earned 500 total points
ID: 39738524
shouldn't line 8 have only 2 doube quotes total?  You mentioned access added ONE, but I see two extra in your code.

>>  & "[EntryDate] Is Not Null And " _
0
 

Author Closing Comment

by:pdvsa
ID: 39738551
thank you.  that was it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now