Link to home
Start Free TrialLog in
Avatar of BSAS_ITGuy
BSAS_ITGuyFlag for United States of America

asked on

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.
Avatar of mildurait
mildurait
Flag of Australia image

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

Avatar of BSAS_ITGuy

ASKER

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.
You will need to establish a primary key on the main table.
Usually this is an auto number field.
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.
ASKER CERTIFIED SOLUTION
Avatar of mildurait
mildurait
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's it, thank you for the solution.