Can I use FindRecord in a form to find a record on a another Form

G

Guest

Same question as Tom K

Am a newbie in this field. Want to insert a new form on the Switchboard,
where users can enter in a keyword ie Project Name and then the Form which
the Project is on (already created) to appear. (The Prjects form is linked
to the Projects table) Don't know how to do this, must I first create a query
and if so what should the criteria be under Project Name. Would like to be
able to use wildcard search. How do I link the query to the Find Record
function and then to my new form
 
S

Steve Schapel

Jonnette,

You can do it either way.

If you have an unbound textbox on the switchboard from, where you can
enter the Project Name, then you can make a Query based on the Projects
table, and in the criteria of the Project Name field you can put the
equivalent of this...
[Forms]![NameOfSwitchboardForm]![NameOfTextbox]
.... and then enter this query as the Record Source of the Projects form.
Then your macro just needs to use an OpenForm action to open the
Projects form, and the required record should be displayed straight away.
If by "wildcard search" you mean you want to be able to enter just part
of the Project Name in the textbox, then the criteria in the query would
be like this...
Like "*" & [Forms]![NameOfSwitchboardForm]![NameOfTextbox] & "*"

Or, you can just leave the Projects form based directly on the Projects
table, and your macro will be like this...
Action: OpenForm
Form Name: Projects
Action: GoToControl
Control Name: [Project Name]
Action: FindRecord
Find What: =[NameOfTextbox]

For a wildcard search, set the Match argument of the FindRecord action
to 'Any Part of Field'.
 
T

tina

to add another suggestion to Steve's excellent instructions: rather than
using a textbox control on your switchboard, you might want to use a combo
box control, with the RowSource based on the Projects table. that way your
users can select from the available, valid project names and get a "hit"
every time.

hth
 

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