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

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

Dirk Goldgar

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".
 
S

Stuart McCall

rsFind.RindFirst stLinkCriteria

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

rsFind.FindFirst stLinkCriteria
 
D

doyle60

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
 
D

Dirk Goldgar

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top