Why I'm getting "Object doesn't support this property or method."

  • Thread starter Thread starter doyle60
  • Start date Start date
D

doyle60

I edit the wizard's code to open a form and go to a specific record to
turn off the filter (which Mr. Wizard annoying does). I've been doing
this for years. I'm trying it again with a new form but I get an
error that says: "Object doesn't support this property or method."
But I can't see anything in the form that would cause this error. Any
ideas? The code is:

___________________

On Error GoTo Err_Command118_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim rsFind As Recordset

stDocName = "QStoreInfofrm"

stLinkCriteria = "[StoreID]=" & "'" & Me![StoreID] & "'"
DoCmd.OpenForm stDocName
Set rsFind = Forms(stDocName).RecordsetClone
rsFind.RindFirst stLinkCriteria
Forms(stDocName).Bookmark = rsFind.Bookmark

Exit_Command118_Click:
Exit Sub

Err_Command118_Click:
MsgBox Err.Description
Resume Exit_Command118_Click
___________________
 
I edit the wizard's code to open a form and go to a specific record to
turn off the filter (which Mr. Wizard annoying does). I've been doing
this for years. I'm trying it again with a new form but I get an
error that says: "Object doesn't support this property or method."
But I can't see anything in the form that would cause this error. Any
ideas? The code is:

___________________

On Error GoTo Err_Command118_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim rsFind As Recordset

stDocName = "QStoreInfofrm"

stLinkCriteria = "[StoreID]=" & "'" & Me![StoreID] & "'"
DoCmd.OpenForm stDocName
Set rsFind = Forms(stDocName).RecordsetClone
rsFind.RindFirst stLinkCriteria
Forms(stDocName).Bookmark = rsFind.Bookmark

Exit_Command118_Click:
Exit Sub

Err_Command118_Click:
MsgBox Err.Description
Resume Exit_Command118_Click
___________________


Look closely at your code. You've mistyped the name of the FindFirst
method, making it "RindFirst".
 
rsFind.RindFirst stLinkCriteria

If that isn't just a typo in your post, then that's the culprit. Should be:

rsFind.FindFirst stLinkCriteria
 
I fixed the spelling mistake and still get the error. I'm thinking it
may be that I didn't create the link in the relationships. I'll try
that soon.

Matt
 
I fixed the spelling mistake and still get the error. I'm thinking it
may be that I didn't create the link in the relationships.

That doesn't make sense to me. Please post the (corrected) code you now
have, and indicate exactly which line is raising the error. You can find
that out by temporarily commenting out the "On Error GoTo
Err_Command118_Click" statement, and then executing the procedure.
 
Back
Top