1 Replies - 742 Views - Last Post: 31 May 2012 - 01:32 PM Rate Topic: -----

#1 evry1falls  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 44
  • Joined: 25-April 12

Data Type Mismatch In Criteria Expression

Posted 31 May 2012 - 01:04 PM

Hello,
This is my first Access 2003 VBA, i was editing a project deals with 2 databases, the 1st one is the same as the project and another external DB, in the Orders screen:
- the Orders form opens multiple queries to retrieve data from and display it on.
- I added textbox to the form and on the Click event i typed this code :

Private Sub Text432_Click()
'EVRY1FALLS
        If CN.State = 1 Then CN.Close
            CN.Open ("provider = microsoft.jet.oledb.4.0 ; data source = C:\StoneEdge\ulbbak.mdb")
            If RS1.State = 1 Then RS1.Close
            RS1.CursorLocation = adUseClient
                RS1.Open "Select * From ORDERS where customerID = '" & fldCustomerID & "'", CN, adOpenDynamic, adLockOptimistic
            Me.Text432 = RS1!Name
End Sub


When i try the project and click in the textbox i get the error message :

Quote

Data Type Mismatch in Criteria Expression


.... i dunno what is wrong or how to solve it !

Is This A Good Question/Topic? 0
  • +

Replies To: Data Type Mismatch In Criteria Expression

#2 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 386
  • View blog
  • Posts: 2,657
  • Joined: 12-January 10

Re: Data Type Mismatch In Criteria Expression

Posted 31 May 2012 - 01:32 PM

data types mismatch is usually associated when data types are not the same

if you access data type for customer id is an int and you are trying to pass a string to it, it will not match up.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1