• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2446
  • Last Modified:

Error: you have chosen forms that can't be linked........

I have an access database that I have several forms in. I am trying to create a main menu form that the user could click on to bring up the other forms. The main menu form was created with no table assigned. I have one button on the main menu form  that brings up the orders form to enter new orders. I am trying to create a button that would open a form I have based on a query. Everytime I used the wizard it will not let me do the "Open form and find specific data to display; I get the error
You have chosen forms that can't be linked.You must have at least one field that can be linked on each form.
0
BSAS_ITGuy
Asked:
BSAS_ITGuy
  • 3
  • 3
1 Solution
 
milduraitCommented:
BSAS
You will need to set up relationships between the source tables in the queries.
Go to tools, relationships, add the tables and define the joins.
You will need to make sure that a one-to-many relationship (Primary, Foreign Key) exists by checking enforce referential integrity.
You can then create a form with subforms.

Eg of Primary Foreign Key Relationship
tblInvoice & tblInvoiceItems
Primary  Key = tblInvoice.InvoiceID
Foreign Key = tblInvoiceItem.InvoiceItemInvoiceID

0
 
BSAS_ITGuyAuthor Commented:
I do have the relationships established but when I go in to click on  "enforce referential integrity" I get the following message

No unique index found for the referenced field of the primary table.
0
 
milduraitCommented:
You will need to establish a primary key on the main table.
Usually this is an auto number field.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
BSAS_ITGuyAuthor Commented:
How do I do this after the table is already established, when I click properties it only gives me a box to type in the Table description.
0
 
milduraitCommented:
We are talking about design view on the table yes?
a) If you do not already have an autonumber field in your table, you can add one.  Once the field is in place, right click it and select Primary Key
b) If this is the case, you will need to add numeric/long fields in your related (or dimension) tables, and then update them to correspond to the appropriate record in the main (or fact) table.
c) Under tools / relationships add the fact and dimension tables and join them (drag the foreign key field in dimension tables to the primary key field in the fact table) and enforce referential integrity (ie a reference in dimension table cannot occur until it exists in the fact table).

Example of Primary / Foreign Key relationship

tblSale (iSaleID is Primary Key in fact table)
iSaleID, sSaleNo
1          A1000
2          A1001

tblSaleItem (iSaleItem ID Is Primary Key, iSaleItemSaleID is foreign key in dimension table)
iSaleItemID, iSaleItemSaleID, sDescription, nValue
1                   1                         WidgetA       100
2                   1                         WidgetB        110
3                    2                         WidgetA        100
4                    2                         WidgetC        150


 
0
 
BSAS_ITGuyAuthor Commented:
That's it, thank you for the solution.
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now