W
W
Hi all,
I have this piece of code which gives me an error : 3072 unknown function
name when I execute rst2.FindFirst cKey.
In immediate mode my cKey seems to be correct.
Sub UpdateCustomer()
Dim cCustomer As String, cNameCustomer As String, cKey As String
Dim db As DAO.Database, rst As Recordset, rst2 As Recordset, wsp As Workspace
Set wsp = DBEngine.Workspaces(0)
Set db = CurrentDb
Set rst2 = db.OpenRecordset("Customers", dbOpenSnapshot, dbReadOnly)
rst2.MoveLast: rst2.MoveFirst
Set rst = db.OpenRecordset("MyOtherTable", dbOpenDynaset)
rst.MoveLast: rst.MoveFirst
Do While Not rst.EOF
cCustomer = Left$(rst.Fields("Customer"), 8)
cKey = "Left$(rst2.Fields(" "Customer" "), 8) = " " " & cCustomer & " "
" "
rst2.FindFirst cKey
…
Loop
rst2.Close
rst.Close
Set rst2 = Nothing: Set rst = Nothing
End Sub
Where do I go wrong ?
Thanks in advance,
W
I have this piece of code which gives me an error : 3072 unknown function
name when I execute rst2.FindFirst cKey.
In immediate mode my cKey seems to be correct.
Sub UpdateCustomer()
Dim cCustomer As String, cNameCustomer As String, cKey As String
Dim db As DAO.Database, rst As Recordset, rst2 As Recordset, wsp As Workspace
Set wsp = DBEngine.Workspaces(0)
Set db = CurrentDb
Set rst2 = db.OpenRecordset("Customers", dbOpenSnapshot, dbReadOnly)
rst2.MoveLast: rst2.MoveFirst
Set rst = db.OpenRecordset("MyOtherTable", dbOpenDynaset)
rst.MoveLast: rst.MoveFirst
Do While Not rst.EOF
cCustomer = Left$(rst.Fields("Customer"), 8)
cKey = "Left$(rst2.Fields(" "Customer" "), 8) = " " " & cCustomer & " "
" "
rst2.FindFirst cKey
…
Loop
rst2.Close
rst.Close
Set rst2 = Nothing: Set rst = Nothing
End Sub
Where do I go wrong ?
Thanks in advance,
W