General discussion
July 29, 2005 at 11:22 AM
hughlee02

dao.recordset.FindFirst

by hughlee02 . Updated 21 years, 2 months ago

I have a syntex error(missing operator) in expression for the FindFirst statement in following code which run in access form vba routine

Option Explicit

Private Sub Form_Load()
On Error GoTo errAddNode

Const strTableQueryName = “Quantity”

Dim db As DAO.Database, rst As DAO.Recordset
Dim strParentField As String
Dim strCriteria As String

Set db = CurrentDb
Set rst = db.OpenRecordset(strTableQueryName, dbOpenDynaset, dbReadOnly)
strParentField = “NEXT ASSEMBLY”

strCriteria = BuildCriteria(strParentField, _
rst.Fields(strParentField).Type, “=” & “21120 – 1”)

rst.FindFirst (strCriteria) ‘syntex error (missing operator) in expression.

exitAddNode: Exit Sub

errAddNode:
MsgBox Err.Description, vbCritical, “Error:”
Resume exitAddNode
End Sub

Help please!!!!

This discussion is locked

All Comments