Hyperlinking Report Data to a Form Record

J

Jonnagc

Hi,
I want to be able to:
1. Run a report
2. Hyperlink the criteria in a field to a form
3. To link that criteria in each row of the specific field, to a
specific record (within the form) containing the same criteria

EG:
If I create a report from an access table which shows football teams
that have scored over 50goals in a season. When I preview the report
it will list the teams and criteria selected to be viewed. I then want
to be able to click on a teams name, and for the hyperlink to take me
to the data entry form of that team.

Is this possible??? Help I could really do with this and I am stuck!
Cheers,
Jonathan
 
R

Russell

Yepo sure is.
I'd say easiest way to do is use the onclick event of the control that
contains the information you want to click on.

Add this to onclick event

Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "ID=" & Me.ID ' This is the where clause for the query
to open your form on the specific record. Change to your primary key or
whatever would work.
stDocName = "formname" ' Replace formname with the name of the form
you want to open
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
J

John Spencer

What version of Access?

In anything before Access 2007, I would say it is not possible to click on an
item in a report and have it respond in any manner. Reports don't support
this type of thing.

I don't know if something like this is possible or not in Access 2007.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

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