Data Type Mismatch in criteria
- From: "mattc66 via AccessMonster.com" <u16013@uwe>
- Date: Thu, 22 Feb 2007 02:36:08 GMT
I have the below code. It stops on the If DCount line and says Data Type
Mismatch in criteria expression. Run-Time Error '3464':
I can't figure out what is wrong..
Private Sub LookUpOrder_AfterUpdate()
' Find the record that matches the control.
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
stLinkCriteria = "[LeadsID]='" & Me![LookUpOrder] & "'"
'Check table for for item number.
If DCount("LeadsID", "TblLead97", stLinkCriteria) >= 1 Then
'Go to record of original Number
Me.Bookmark = rsc.Bookmark
'If the item is not found the below code is run.
'Message box warning that part number doesn't exsist.
MsgBox "Order Number" _
& SID & " is not valid order number," _
& vbCr & vbCr & "check the number and try again." _
& vbCr & vbCr & "If the order is still not found" _
& vbCr & vbCr & "contact order entry.", vbExclamation _
, "ORDER NOT FOUND"
Set rsc = Nothing
mattc (at) saunatec [dot] com
Message posted via http://www.accessmonster.com
- Prev by Date: Re: SQL phrasing
- Next by Date: Updating multiple records at once on a form
- Previous by thread: SQL phrasing
- Next by thread: RE: Data Type Mismatch in criteria