How run .FindFirst on field in table but not on form?

G

Guest

This code runs after a click on Me.ComBx2. The combox is based on a query
using two tables, DonorTbl & MatchTbl. I want to go to the record in
MatchTbl which matches the combox. The field in MatchTbl is MchDonID. But
rst.NoMatch keep coming up True. I THINK my problem is that I don't know how
to refer to the table. Any help would be much appreciated. Thanks.

Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
With rst
..FindFirst "[MchDonID]= '" & Me.ComBx2.Column(0) & "'"
End With
 
B

Brian Bastl

Dave,

What is the rowsource for ComBx2? Is MchDonID stored as a text value or is
it a numeric value?

Brian
 
G

Guest

Brian,

Your question makes me realize I gave the wrong information. While the form
is based on the two-table query, the dropdown RowSource is actually a Select
query based on one of the tables. However, the selection does include
MchDonID, which is a text field. (It includes both string & numeric
characters.)

Thanks for looking into this for me.

--
Dave


Brian Bastl said:
Dave,

What is the rowsource for ComBx2? Is MchDonID stored as a text value or is
it a numeric value?

Brian


LongWayFromHome said:
This code runs after a click on Me.ComBx2. The combox is based on a query
using two tables, DonorTbl & MatchTbl. I want to go to the record in
MatchTbl which matches the combox. The field in MatchTbl is MchDonID. But
rst.NoMatch keep coming up True. I THINK my problem is that I don't know how
to refer to the table. Any help would be much appreciated. Thanks.

Dim rst As DAO.Recordset
Set rst = Me.RecordsetClone
With rst
.FindFirst "[MchDonID]= '" & Me.ComBx2.Column(0) & "'"
End With
 

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