Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using rst.Find with non-PK fields

Status
Not open for further replies.

lestermadoc

Programmer
Sep 9, 2001
26
0
0
US
'The following five lines work...

Private Sub cmbjump_AfterUpdate()
searcher = (Nz(Me![cmbjump], 0)) 'cmbjump is a combo box
searched = "[cid]" '[CID] is the primary key
jumpsearch 'jumpsearch is a function which I listed below.
End Sub

'But these five lines don't (Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another).

Private Sub cmbjump2_AfterUpdate()
searcher = (Nz(Me![cmbjump2], 0))
searched = "[lastname]"
jumpsearch
End Sub

function jumpsearch()

Set rs = Form_record.Recordset.Clone
rs.Find searched & " = " & searcher
If Not rs.EOF Then Form_record.Bookmark = rs.Bookmark

end function

Anyone know how I can get this to work?
 
I'm not sure why it's doing this, but I think it's because you can only search this way by primary key.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top