conditional display field from different table

  • Thread starter Thread starter andy
  • Start date Start date
A

andy

I have two dbs.
1st db with tablename Purch
Purch has fields ContractNo, ContractSuffix (concatenated
keys), and PreContractNo.
2nd db with tablename Park
Park has fields PreContractNo, text1, text2

On a form in the 2nd db, I want to display
PreContractNo, text1, text2 - no problem, right from
table! however,
If the 2nd db Park.PreContractNo finds a match in the
Purch.PreContractNo then I would like to display the 1st
dbs Purch.ContractNo, and Purch.ContractSuffix in the 2nd
db's form.

I know I can accomplish this by building a query using an
outer right join, and setting the form against the querry.

I do not want to relate the db/tables.

Is there a way to address this just in the text box,
perhpas something like the following?
If Purch.PreContractNo = Park.PreContractNo and then
Purch.ContractNo and then likewise
If Purch.PreContractNo = Park.PreContractNo then
Purch.ContractSuffix

Do I link the 1st db table to the 2nd db?
View Only information from the outside db is great.

What is the best way to do this?

Eventually, I will need to do the opposite, and
conditionally display items from 2nd db in the 1st if the
PreContractNo's match from the 1st, however still display
all other items in the 1st db.

Help! Please.
God bless you.
 
Hi Andy,

Joining the tables in your query doesn't create a relationship between
them, if that's what you're worried about.

Alternatively, put code in the form's Current event procedure that uses
DLookup() to fetch a value from the other table if required.
 
Back
Top