Finding a record for update on a form

G

Guest

I am a new user of Access and am trying to create a form that will retrieve
an existing record from a file with 3 keys. The file will have hundreds of
records so I’d like not to scroll through the records to find the one I want
the form to edit.

I would like to create a form that will retrieve the record by using 3 list
boxes, one for each key. After locating the record, I would like to display
and allow the non-key fields to be edited.

I can create a form with the 3 list boxes and the other fields for edit.
However, once the entries are made in the list boxes, the other fields do not
update with the information in the selected record. What am I missing?
 
G

Guest

I would have two forms
(1) A search form
(2) A view/update form

The search form has the combo boxes at the top and the list of found records
in a listbox at the bottom (assuming you may find more than one record).

You then have a command button that opens up the second form based on the
record selected in the listbox. The record source of this form (which must be
set in the 'open' event of the form) will be the entire table filtered by the
key of the selected record. Its not too difficult to add the capability to
page back or forward through the records found in the search form.

Dorian
 
G

Guest

Thanks, I've tried this and seem to be missing something. When I open the
update form it opens with only one of the correct key fields and others are
incorrect. The open statement appears to include only one field from the
table. See below:

stLinkCriteria = "[Policy Type ID]=" & "'" & Me![Policy Type ID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Can I edit this statement to add the other key fields? What is the format
to do this?

Thanks
 

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