PDA

Click to See Complete Forum and Search --> : Making Relationships?


jeffro
Nov 15th, 2000, 08:11 AM
HI

I'm trying to make relationships in my database, but I keep getting an error. The error tells me Microsoft Access can't create this relationship and enforce referential integrity. Something about the data in the primary table not having the same data as the other table.
This is what I did: I imported 3 similiar tables from another database into my database. Then I went into each table and made sure the data was matching the primary tables data. But I'm still getting the error above.

Does anyone know what's going on?

jeffro

paulw
Nov 15th, 2000, 08:40 AM
Are the data types of the fields the same? The exact error message is important. The only other thing I can think of is that there are values in the Secondary tables that are not present in the Primary table. This will prevent a relationship being formed.

You can check this easily by doing an outer join query - select the two tables in the query designer, join the selected fields and click on the join. Select all records from secondary table and only matching records from primary table. Put both fields into the grid and run the query. Unmatched fields in the Primary table will be shown as Null

Hope that helps.

P.

jeffro
Nov 15th, 2000, 09:50 AM
Hey thanks paulw that worked great. Actually I didn't even know that access could do that.

I have one more question. I have a field called machineno and it is a text field. It allows numbers and text. Well I have a machineno that is suppose to be IHS but when I click to another field the IHS goes to HIS. Is there a way around this?

thanks jeffro

jeffro
Nov 15th, 2000, 10:51 AM
I figured it out. Just go to Tools and then autocorrect and uncheck the replace as typed.

Thanks Paulw for earlier!