docmd.findrecord

S

seeker

I have a form with a textbox that onchange finds the nearest string that is
typed into the textbox in a subform that is a list of customers. If the
docmd.findrecord is keyed to the first column it works great but I now want
it to search a field in the query behind the subform which does not show on
the subform as a text box. For instance if I start to type wei in the
textbox the subform will immediately go to a record that has wei as the first
three letters in the first column of the subform as it should do but on a
different form that searches for full name the letters nes should find the
first name nearest nes and then show that record which in this case would be
the record whose first column is wei. Instead it goes to records that start
with nes in the first column. I would share the form/subform with you but am
not sure how to. Thanks.
 
D

Daryl S

Seeker -

The FindRecord has an optional parameter to search only the current field or
all fields. (Look it up in Help.) You cannot choose a certain field to
search in the command line, but you could set the current field to be the one
you want to search on.

If you do not show the field you would like to search on, then you could try
the option to search all fields - it will still return results in the first
column, but would also return the records you are looking for.
Your other option is to show the field you want to search on, find the
record, and then hide the field again.
 

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

Similar Threads


Top