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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 97

Status
Not open for further replies.

czink9

IS-IT--Management
Sep 13, 2005
9
US
I have two tables, Account and Location, and I am trying to verify that the sales code and location id in the account table have a corresponding row in the location table. However, my problem is that in the location table, I have multiple rows for the same sales code. Can someone please provide some assistance on how I can verify that the sales code and location id values for each account are equal to the sales code and location id in the location table?
 
Hmm, I was just about to answer your post in the Microsoft Office forum. :)
How about Dlookup?
DLookup Function Examples
faq705-4978
 
Will this work even though I am not putting them into a form or a report?
 
No. Perhaps you could provide a bit more detail? For example, if you are entering data directly into a table, you have very little control.
 
In the Account table, I have an account number, a sales code and a location id. In the Location table I have a sales code and a location id. All of this information has been imported from other sources. I need to perform a mass compare on the account table to verify that the sales code and location id have a record in the location table. Hope this clarifies this issue. If you need additional information, please ask.
 
Have a look at RelationsShip and Referential Integrity.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
A query may help show up existing problems, if you have already imported the data:
Code:
SELECT tblAccounts.AccountNo, tblAccounts.SalesCode, tblAccounts.LocationID, tblLocations.LocationID, tblLocations.SalesCode
FROM tblLocations RIGHT JOIN tblAccounts ON (tblLocations.SalesCode = tblAccounts.SalesCode) AND (tblLocations.LocationID = tblAccounts.LocationID)
WHERE (((tblLocations.LocationID) Is Null)) OR (((tblLocations.SalesCode) Is Null));
Then Referential Integrity will prevent any more problems.

Hope I have that right. [dazed]
 
How are ya czink9 . . . . .

Have you tried the [blue]Find Unmatched Query Wizard![/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top