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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Set Lookup for Multiple Fields 1

Status
Not open for further replies.

Steven547

Technical User
Sep 15, 2004
165
US
I'm just learning all the Recordset functions, so I need a little help. I have a form with two specific fields. You enter (in the combo box) the Trust you want, then in the other field, you enter the claim number. Reason I have trust, is because you can have the same claim number for each trust (but different persons name, etc). Therefore, both fields have to be completed. This is my code:

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Claim_Num] = " & str(Nz(Me![Combo49], 0))and rs.FindFirst "[trustID] = " & str(Nz(Me![cboTrustSelect], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


(Combo49 is my claim number entry field on the current form along with cboTrustSelect.) However, in the above, I received an "EXPECTED END of STATEMENT" on my "[trustID]. What am I doing wrong?
 
rs.FindFirst "Claim_Num=" & Nz(Me![Combo49], 0) & " AND trustID=" & Nz(Me![cboTrustSelect], 0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the quick feedback! It works now!!

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top