insert more than one hyperlink

  • Thread starter Thread starter hyperkink
  • Start date Start date
H

hyperkink

Hi: I am trying to insert more than one hyperlinks, i know i need to create a
related table. But how to do it?
I also tried to link a table first, and this tables contians many other
hyperlinks. However, it worked well at the table formate, and when I save the
table and return to a form(which cantains this table), it shows an error
message that, "The changes you requested to the table were not successful
because they would create duplicate values in the index, primary key, or
relationship."
Please help me to find out how to insert more than one hyperlinks.
Thank you
 
The hyperlinks need to be in a related table.

tblMain
MainID (primary key, or PK)
Field1
Field2

tblLink
LinkID (PK)
MainID (foreign key)
LinkText (the hyperlink)

If MainID in tblMain is an autonumber, MainID in tblLink must be a Number
(Long Integer). If MainID in tblMain is anything other than autonumber,
MainID in tblLink must be the same.

Open the Relationships window by clicking Tools >> Relationships. Add both
tables. Drag MainID from one table and drop it on MainID in the other
table. When the dialog box appears, click "Enformce Referential Integrity".
Close the Relationships window.

Create a form )frmMain) based on tblMain, and another (sfrmLink) based on
tblLink. For the form based on tblLink, set the Default View to Continuous.
By "based on" I mean that the table is the form's Record Source.

Use the toolbox to draw a subform/subreport control on frmMain. If its
property sheet is not open, open it by clicking View >> Properties while the
subform control is selected. Give it a name such as fsubLink. Set its
Source Object to sfrmLink. Click Link Child Fields, and click the three
dots at the right. It should suggest MainID as the linking field. Accept
the suggestion.

Now for each main form record you can have as many subform records (links)
as you want.
 
Back
Top