Pick List Coding and Object Required Error

R

Ray Todd

I am using the following code. When run, I get RunTime Error 424: Object
Required. The line where the error occurs is:

R.FindFirst "[PropertyAddress] = " & frmPICKLIST!Names

Any help determining what I am missing would be much appreciated.

Private Sub Names_DblClick(Cancel As Integer)
Dim F As Form
Dim R As DAO.Recordset
Set F = Forms![frmPROPERTYSUMMARY]
Set R = F.RecordsetClone
R.FindFirst "[PropertyAddress] = " & frmPICKLIST!Names
F.Bookmark = R.Bookmark
DoCmd.Close acForm, Me.Name
End Sub


Thanks,

Ray.
 
X

xRoachx

Hey Ray, I'm guessing that the Names field is a text field. If so, you need
quotes around the variable:

R.FindFirst "[PropertyAddress] =""" & frmPICKLIST!Names & """"
 
B

Brendan Reynolds

There is no variable named 'frmPICKLIST' declared in the code you posted. Is
it a global or module-level variable, or was it intended to be a reference
to an open form? If the latter, it should be Forms!frmPICKLIST.

BTW: If PropertyAddress is a text field, you'll need quotes around the
value: "[PropertyAddress]='" & Forms!frmPICKLIST!Names & "'"

That's a single quote followed by a double quote after the "=" and a single
quote between two double quotes at the end.
 

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