Making contents of field hyperlinks that open a form containing that records fields

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi all

This is a little complicated to explain so please bare with me.

I am tying to create a task management system. I have a table (tasks)
with eleven fields. I would like the task field to be a hyperlink that
when clicked on in form view opens a form showing selected fields. Is
there anyway of automating this process?

Hope that is clear!

Many thanks in advance for any help.

Paul
 
Open your form in a design view. right click the control and click on
properties --> in the Format tab click IsHyperlinked as "Yes".
Now click on the Event tab in the properties window and write the
following code in the OnClick event to open a particular form
corresponding to a particular record (in this case it will be the
record which has been click by the user)

paste the following code

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "xyzform" 'replace xyzform with the name of the form
you want to open

stLinkCriteria = "[ID]=" & Me![ID] 'Me![ID] is assumed to be
the data on which the user clicks and [ID] is the data on the form that
would be opened upon clicking
DoCmd.OpenForm stDocName, , , stLinkCriteria

I hope this help..

Rex
 
Hi Rex

Many thanks for your help and it almost seems to work.

My very limited coding experience is obviously doing something wrong
with the last bit. What bits should I replace the "[ID]" and Me![ID[
parts of the code and what with?

The field the user clicks on in the first form (task_list) is called
'Task' and it opens the same field in a the second form (task_detail).

Thanks again

Paul
Open your form in a design view. right click the control and click on
properties --> in the Format tab click IsHyperlinked as "Yes".
Now click on the Event tab in the properties window and write the
following code in the OnClick event to open a particular form
corresponding to a particular record (in this case it will be the
record which has been click by the user)

paste the following code

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "xyzform" 'replace xyzform with the name of the form
you want to open

stLinkCriteria = "[ID]=" & Me![ID] 'Me![ID] is assumed to be
the data on which the user clicks and [ID] is the data on the form that
would be opened upon clicking
DoCmd.OpenForm stDocName, , , stLinkCriteria

I hope this help..

Rex

Hi all

This is a little complicated to explain so please bare with me.

I am tying to create a task management system. I have a table (tasks)
with eleven fields. I would like the task field to be a hyperlink that
when clicked on in form view opens a form showing selected fields. Is
there anyway of automating this process?

Hope that is clear!

Many thanks in advance for any help.

Paul
 
Here's some more info:

Here is the code I have:

Private Sub Task_Click()
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "task_details"

stLinkCriteria = "[Task]=" & Me![Task]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub


When I run this code I get the following error message:

Run-time error '3075'

Syntax error (missing operator) in query espression '[Task]=Send
Jupiter Colour new website footer details'.


The later bit of text is the text in the field the user has to click on
to get access to open the task_details form.

Any help very gratefully received.

Paul


Hi Rex

Many thanks for your help and it almost seems to work.

My very limited coding experience is obviously doing something wrong
with the last bit. What bits should I replace the "[ID]" and Me![ID[
parts of the code and what with?

The field the user clicks on in the first form (task_list) is called
'Task' and it opens the same field in a the second form (task_detail).

Thanks again

Paul
Open your form in a design view. right click the control and click on
properties --> in the Format tab click IsHyperlinked as "Yes".
Now click on the Event tab in the properties window and write the
following code in the OnClick event to open a particular form
corresponding to a particular record (in this case it will be the
record which has been click by the user)

paste the following code

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "xyzform" 'replace xyzform with the name of the form
you want to open

stLinkCriteria = "[ID]=" & Me![ID] 'Me![ID] is assumed to be
the data on which the user clicks and [ID] is the data on the form that
would be opened upon clicking
DoCmd.OpenForm stDocName, , , stLinkCriteria

I hope this help..

Rex

Hi all

This is a little complicated to explain so please bare with me.

I am tying to create a task management system. I have a table (tasks)
with eleven fields. I would like the task field to be a hyperlink that
when clicked on in form view opens a form showing selected fields. Is
there anyway of automating this process?

Hope that is clear!

Many thanks in advance for any help.

Paul
 

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

Back
Top