L
.Len B
Here is a snippet of code which fails with error
3251: Operation is not supported for this type of object.
Set rstPay = db.OpenRecordset("Payments") 'open table 1 side
Set rstInv = db.OpenRecordset("Invoices") 'open table many side
rstPay.MoveFirst
rstInv.MoveFirst
With rstPay
Do Until .EOF
...
strRef = !Ref 'PK in Payments (same spelling FK in Invoices)
===> rstInv.FindFirst "Ref = " & strRef 'find first matching invoice
With rstInv
Do Until .EOF
...
Loop
End With
Loop
End With
I have used this construct to find the first match in a recordset many
times before but now I am at a loss to know where to look. Help says
method is usually valid but not in this case.
I have looked at help for OpenRecordset but this particular syntax is
not shown. I have to assume that the recordset has some default
attribute preventing finds but what is it? How do I find out?
(Access 2003)
3251: Operation is not supported for this type of object.
Set rstPay = db.OpenRecordset("Payments") 'open table 1 side
Set rstInv = db.OpenRecordset("Invoices") 'open table many side
rstPay.MoveFirst
rstInv.MoveFirst
With rstPay
Do Until .EOF
...
strRef = !Ref 'PK in Payments (same spelling FK in Invoices)
===> rstInv.FindFirst "Ref = " & strRef 'find first matching invoice
With rstInv
Do Until .EOF
...
Loop
End With
Loop
End With
I have used this construct to find the first match in a recordset many
times before but now I am at a loss to know where to look. Help says
method is usually valid but not in this case.
I have looked at help for OpenRecordset but this particular syntax is
not shown. I have to assume that the recordset has some default
attribute preventing finds but what is it? How do I find out?
(Access 2003)