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
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