How do I show individual records

  • Thread starter Thread starter takatam
  • Start date Start date
T

takatam

Hi,

In my access database I have a 3 tables containing information on
documents, which document links to which document and the past users
of each document.

What I would like to build is a page in which the user can select
(using drop-down) a document by the ID, and is then presented with the
details of that document, which documents it links to and who used it
in the past. The underlying data should not be accessible for the user
to edit.

Which page type do I best use for this?
- It's not really a form because I don't want the user to be able to
edit/add/change data. While it has a drop-down list, I don't know how
do use the selected value to bring up the corresponding data into the
other fields. Basically, I would like to be able to scroll through the
data sets using the drop-down instead of the record-selector at the
bottom of the form screen.
- It's not a report because the user should be able to select records
dynamically, easily changing from one to the other.
- It's not a query because there's no nice graphical representation of
the result which should not be a table.

Can anyone help me with this?

Any help is much appreciated,
T
 
You can change all the fields on a form to not be editable. If you right
click on the little square box in the top left of a form in design view, then
select the data tab, you can set the "Allow Edits" property to false. You
can also do this with vba code. As for the subset of document information, I
would use a subform in continous form view. To view the selected record, if
you add a button on your page and when the wizard comes up select Form
Operations, then Open Form and hit next. Then you would select the form you
want to open, and the next dialog box asks you if you want to open the form
to show all records or to find specific data to display. Select find
specific data to display. In the next dialog join the to fields in the two
tables, click the <-> button, select your display text, and name your button.
Now you can go into your vba code and see how access opens a form with
specific data.
 
Hi,

I was just shown that the right choice for me is a form whereby I can
turn all those problem points off in the properties section.

So I need to put a drop-down onto the form and then link all other
values to be results of queries.

Hope this helps someone,
T
 
iletide sunu yazdi said:
Hi,

In my access database I have a 3 tables containing information on
documents, which document links to which document and the past users
of each document.

What I would like to build is a page in which the user can select
(using drop-down) a document by the ID, and is then presented with the
details of that document, which documents it links to and who used it
in the past. The underlying data should not be accessible for the user
to edit.

Which page type do I best use for this?
- It's not really a form because I don't want the user to be able to
edit/add/change data. While it has a drop-down list, I don't know how
do use the selected value to bring up the corresponding data into the
other fields. Basically, I would like to be able to scroll through the
data sets using the drop-down instead of the record-selector at the
bottom of the form screen.
- It's not a report because the user should be able to select records
dynamically, easily changing from one to the other.
- It's not a query because there's no nice graphical representation of
the result which should not be a table.

Can anyone help me with this?

Any help is much appreciated,
T
 
If we assume that the primary key column of the form's underlying table is a
numeric DocumentID, e.g. an autonumber, then add an unbound combo box,
cboFindDocument say, to the form set up along these lines:

RowSource: SELECT DocumentID, Document FROM Documents ORDER BY Document;

BoundColum: 1
ColumnCount: 2
ColumnWidths: 0cm;8cm

If your units of measurement are imperial rather than metric Access will
automatically convert the last one. The important thing is that the first
dimension is zero to hide the first column and that the second is at least as
wide as the combo box.

In the AfterUpdate event procedure of the combo box put:

Dim rst As Object
Dim ctrl As Control

Set rst = Me.Recordset.Clone

With rst
.FindFirst "DocumentID = " & cboFindDocument
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

At a more fundamental level, when you say a document refers to a document,
can the referenced document refer to yet another document and so on? If so
then things become rather more complex as you need to query recursively to
'drill down' through an arbitrary number of levels. Recursive querying can't
be done directly, but it can be simulated. I did produce a little demo file
of how this can be done some years ago for a magazine column. I don't think
its available on-line any longer, but I can send it to you if you mail me at:

kenwsheridan<at>yahoo<dot>co<dot>uk

Ken Sheridan
Stafford, England
 
Back
Top