Suddenly "Method or data member not found" came up

kirenaj

New member
Local time
Today, 19:42
Joined
Oct 26, 2012
Messages
3
Hi! Please help me with this one: I have this code as below that was working. I was just working with something, and suddenly the message "Method or data member not found" came up for the code highlighted in red.
I then tried to rem out this code. Then I got the "Run-time error 3464" and the code in blue was highlighted.
I have used some time to google on this, have tried to use the repeair db function, also tried to start with a new db, and import tables and forms into this.

Dim sqlstr As String
Dim x As Integer
Dim rec, rec2, recOrders As Recordset
Dim dbs As Database
Dim qdfChange As QueryDef
Set dbs = CurrentDb
Set rec = dbs.OpenRecordset("tbl_tmpoutgoing", dbOpenDynaset)
rec.Filter = "palletno='" & Me.PalletNo & "'"
Set rec2 = rec.OpenRecordset
x = 0
rec2.MoveLast
If rec2.RecordCount > 0 Then
rec2.MoveFirst
Do Until rec2.EOF = True
'sqlstr = "UPDATE tbl_order SET DTonpallet = '" & Now & _
'"',palletno = '" & Me.PalletNo & "',palletcmnt = '" & Me.Comment _
'& "' WHERE [SN manuf]='" & rec2.[sn manufactor] & "'"
Set qdfChange = dbs.CreateQueryDef("", sqlstr)
qdfChange.Execute
x = x + 1
rec2.Delete
rec2.MoveFirst
Loop
Me.Closed = True
Me.Requery
End If
MsgBox "Totally " & x & " records were updated for pallet no " & Me.PalletNo
End If
Exit Sub
 
Check your form is the object "PalletNo" exists.

Also looks like you got an extra ' somewhere.... try

Code:
"',palletno = '" & [COLOR=red]Me.PalletNo[/COLOR] & "',palletcmnt = '" & Me.Comment _
 
Dear Jonathan! Thank you for your input to me! -I think you were into something. I started on new with it, and got it right. It is easy to make mistakes in such strings when you got many fields and variables in it... :-)
 

Users who are viewing this thread

Back
Top Bottom