How to use FindRecord command?

G

Guest

I can't figure out how to use the FindRecord command.

I have read about it in Microsoft Access Help, but it does not give any
examples.

I have a form based on a table (tblSAR). While the user is already on the
form, I want them to be able to go to another SAR_ID. I have tried using a
default Find button. That doesn't work because it looks for the first record
that meets the criteria in any field, not the field that I want it to look in
(SAR_ID).

I don't know if this command pops-up a form for the user to enter the value
to search for or if I need to get the value from a text box on the form.

Can anyone help me with this command?
Thank you, Judy
 
D

Dirk Goldgar

Judy Ward said:
I can't figure out how to use the FindRecord command.

I have read about it in Microsoft Access Help, but it does not give
any examples.

I have a form based on a table (tblSAR). While the user is already
on the form, I want them to be able to go to another SAR_ID. I have
tried using a default Find button. That doesn't work because it
looks for the first record that meets the criteria in any field, not
the field that I want it to look in (SAR_ID).

The user can change setting in the Find dialog to search only the
current field. But that's a general-purpose find function. For a
specific purpose like this, you can do better.
I don't know if this command pops-up a form for the user to enter the
value to search for or if I need to get the value from a text box on
the form.

Can anyone help me with this command?

FindRecord supplies the same functionality that underlies the built-in
Find dialog, but without the user interface. For the purpose you
describe, I wouldn't use it. Instead, I'd use the combo box wizard to
add a "Find SAR" combo box to the form, and tell the wizard to create a
combo box to "find a record on my form". The wizard should be able to
take it from there with only a little additional input from you.
 
S

Steve Schapel

Judy,

Well, how do you want the user to identify the record they want to find?

Here's an example of how to use this method...

In the Form Header, put an unbound combobox that lists all the SARs, and
has its Bound Column property set to the SAR_ID column in its Row Source
(post back if you don't know what I mean here). Let's say you name this
combobox FindSAR. Now, on the After Update event of this combobox, put
code like this...

Me.SAR_ID.SetFocus
DoCmd.FindRecord Me.FindSAR
Me.FindSAR = Null
 
G

Guest

Hi Judy,

You've had a couple of good replies from a couple of MVPs (which I'm not; I
wonder whether or how I could become one?). But I'd like to ask a simple
question - how many SARs (very roghtly!!) do you expect your table to have
eventually? If it's a relatively small number, then the combo box suggestion
is fine; if it's several thousand then you'll need a different solution,
namely a separate list form (which users can then filter - say to find all
people called 'Smith", or everyone in "London", or whatever). Could you
imagine scrolling through thousands of names every time you want to change
record?

Let me know if this helps and if you'll need further pointers on the list
form idea.

All the best,
 
S

Steve Schapel

Laury,

You have a good point. However, given the wonderful feature of
comboboxes called Auto Expand, Row Sources of thousands of items are
often very manageable. Typing the first 1 or 2 or 3 characters of the
SAR will serve the same purpose as your "separate list form", but
probably more efficiently.
 
G

Guest

Steve,

I take your point about auto-expand - but the reason that I first set up the
solution I proposed (and adopt as a standard in my applications) is that the
client asked a question on the lines of "suppose I don't know the first part
of the name?"

As an aside, am I correct in assuming that MVP = Microsoft Validaterd
Professional, or similar? Becasue from my browsing of the newsgroups in the
last few days you guys generally give the best answers!
 
G

Guest

Steve

Many thanks!

Having benefited myself, I plan to continue trying to help others in the
communities.

All the best from London UK
 

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