How do I run a query to find a specific record?

C

Chris76

I think this is a fairly simple question but i couldnt find it browsin
the board..

I have a database that has a tabbed form where users input their cas
information...

There would be occasions where users would need to update a cas o
complete a case.

How do I design a query that could look up the case folder ID (whic
is the primary key throughout the database) to open the form containin
that specific record? I think its a parameter query but I need it t
open the form so the users can input data..

Thank
 
N

Neil

Chris,

You're right, this is a fairly easy question to answer.

Create a new query that retrieves all the records from your table, and in
the 'Criteria' section for the ID field enter the following line:
[Enter Case ID Number]

This will create a query that will ask the user for a particular case ID.

Now copy your original tabbed form and give it another name.
Open the form in design mode, open the properties sheet for the form, and in
the record source dialog select the name of the query you created above.

Now all you need to do is open the form from your switchboard or menu, your
user will be prompted with the question, and the form will then display the
correct record assuming it exists. ( You may need to build in some error
trapping to ensure this can't happen, but that's a whole different subject)

HTH

Neil
www.nwarwick.co.uk
 
C

Chris76

Thanks for the reponse.. but there are multiple tables which make up th
form which in turn creates an individual case.... you want me t
individually select every field in every table for the query? I hav
over 175 different field--probably more-- that doesnt seem like
logical way to do this.
 
M

Michel Walsh

Hi,

You can open the form with DoCmd and use the parameter WhereCondition:


DoCmd.OpenForm "FormName", whereCondition:= "ID=" & ParameterID


Hoping it may help,
Vanderghast, Access MVP
 
Top