Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationship using specific characters?

Status
Not open for further replies.

Joshua61679

Technical User
Dec 28, 2001
36
US
This may be a terrible idea, if you think there's a better way to accomplish what I'm trying, let me know.

I've got a number of tables that have test results, with each test having it's own table. One of those (for example purposes) is "Dent".

For identification purposes, we've created variable numbers for each sample. The variable number is a combination of things unique about the sample. The last 2 characters of the variable reference the End Code of the sample. Each end has a few fields (coating, tooling, layers) which in combination make that end unique.

I'd like to create a relationship between "Variable" on the "Dent" form and "End Code" on the "End Codes" form so that I could run a report based on a query that pulls the two tables together.

So ideally the Join should connect forms!dent!variable which has the value of "???QW", with forms![End Codes]![End Code] which has the value of "QW", thus giving me all of the test results and all of the end information together.

Is this possible? Or is there a (better) way to connect this data for reporting and searching purposes without a setting up a relationship? Or do I need to add an "End Code" field to my table and have it populate based on variable?

I'm trying to avoid the last option if possible, but am willing to do it if it is clearly the superior option.

Thanks in advance for any advice!
 
Joining is done on exact matches so the column(s)/field(s) should exist in both tables. Generally you join unique index / primary key in one table to a foreign key in the second table. Usually in a situation where a table has no obvious unique column, a new auto number field is added to be the primary key. Typically such a column is the table name with ID added at the end. So an Order table might have an OrderID primary key.

That said, If I read your post right, you already have "QW" in columns in both tables to start with. So I don't understand why you would not just join on that to start with.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top