View Single Post
  #6  
Old February 10th, 2010, 10:23 PM posted to microsoft.public.access.tablesdbdesign
Tedmi
external usenet poster
 
Posts: 141
Default Linking to record in form view

As Gina says, you need to create a form whose data source is the table in
question. Display the form in datasheet or continuous view. On one of the
fields of the form, establish a double-click event that executes this code:
DoCmd.OpenForm FormName:="YourFormName", View=acNormal,
WhereCondition:="[ID]= & txtID

Where YourFormName is designed to display a single record from your table
(presumably with more detail than displayed in the datasheet view), txtID is
the name of the control holding the unique identifier of the row on which
you clicked, and [ID] is the name of the field in the underlying table that
holds this identifier.

This method will limit the single-record form to the one record identified
by ID. If you would to allow the user to navigate to other records in
single-record view, use this instead:
DoCmd.OpenForm FormName:="YourFormName", View=acNormal, OpenArgs:=txtID

Then in the Load event of YourFormName, execute this code:

If Len(Nz(OpenArgs, "")) 0 Then
Me.Recordset.Clone.FindFirst "[ID]=" & OpenArgs
Me.Recordset.Bookmark = Me.Recordset.Clone.Bookmark
End If
Good luck!

-TedMi

"Gina Whipp" wrote in message
...
TES,

Not from table view but it can be done using a form. You can create a
form
to look like your table and place a hyperlink on it to open another form,
with something like...

DoCmd.OpenForm "YourFormName"

Tables are meant to just hold the data not interact with it.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"TES" wrote in message
...
I would like to have a link in one of the columns in my table view that
will
take the user to that record displayed in a form view. Is this possible
to
do in an existing base?

Thanks.