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

Findfirst criteria 1

Status
Not open for further replies.

Thunder2781

Programmer
May 9, 2005
14
NL
Hi,

I would like to do a search in a table with findfirst but I get an error for my criteria.

What I would like is something like this:

rs.fields(customer).value = search_value

Where search_value is a value from a combobox.

Hopefully somebody can help because I have tried a lot of different options but I can't get it working.
 
Hithunder

try something like

rs.FindFirst "[field] = " & me!comboboxname

Ian Mayor (UK)
Program Error
Programmers do it one finger at a time!
 
The problem is that it's not working. I will get an error on using that line. I get an error something like value doesn't match or something like that.

And I wouldn't like to specify a field but I would like to use a variable for it.

Hope somebody could help me out because I have tried it but it is not working.

Thanks so far
 
Something like this ?
search_value = Me![combo name]
search_where = "name of field"
[tt]rs.FindFirst "[" & search_where & "]='" & search_value & "'"[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top