Link to home
Start Free TrialLog in
Avatar of pdvsa
pdvsaFlag for United States of America

asked on

Where condition, datatype mismatch error.

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
Avatar of pdvsa
pdvsa
Flag of United States of America image

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Korbus
Korbus

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pdvsa

ASKER

thank you.  that was it.