Recordset Find

R

redrover

I'm trying to use the recordset Find to filter the recordset in my code. I
keep getting an error with the syntax. I think it has something to do with
trying to use a control field on the form for the Find. My statement:

rst.Find "SSN=ME.SSN"

SSN is the name of the field in the recordset.
ME.SSN is the control field on the form.

How can I do this so that I only get the records in the recordset that match
SSN field in the form (ME.SSN is a field on the form)?
 
D

Douglas J. Steele

Assuming SSN is a text field,

rst.Find "SSN='" & ME.SSN & "'"

Exagerated for clarity, that's

rst.Find "SSN= ' " & ME.SSN & " ' "

If SSN isn't a text field, it should be. <g>
 
R

redrover

Thanks you! SSN is a text field but the ME.SSN was defined as a numeric
field in the table. I created a text field for ME.SSN but now I'm getting an
error 'Rowset does not support scrolling backward'. I added
cnn.CursorLocation = adUseClient which I thought would take care of that
error but I'm still getting it. Any ideas on what I've messed up in the code?
 
R

redrover

I got the error taken care of that I had in my previous post. Thanks for the
help!
 

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