Automatically Selecting Values

Cavern

Registered User.
Local time
Today, 20:33
Joined
Jul 12, 2002
Messages
31
Heya all, just had a quick question (at least I hope its quick)...

I've got a database I'm working on here that holds some information about companies, names, sales, etc... There's a specific field that holds a classification number (NAICS #). The NAICS Sectors (General Categories) and Descriptions (well.. Descriptions) for each number are stored in a seperate table (just to be clear, each NAICS number has its own Sector and Description defined in the NAICS table). The NAICS number for each buiness is stored in the company information table.

The user selects the NAICS number on a form I have setup in the following way: they choose the NAICS sector (Category) from a combo-box, and then a list box below is populated with the corresponding descriptions and numbers, then when the user picks one of them, the number is entered into the field in the buisness information table... My problem is this:
I would like to have the NAICS Description and Category selected for each user automatically for each record when they browse between them (right now they're just blank when you change records)... Is there some way I can set this up? I've been puttering away at it for some time and I dont seem to be makingn any headway..

thanks in advance
-Cavern
 
Okay... I setup the form so its source was a join query and based the form off of that, but I've run into another little snag, some of the companies dont have NAICS information filled in, and now they aren't accessable.. Is there a way to tell it you want to show all records even if some of the joined fields are empty??

Here's the code for the join, in case that helps:
SELECT [Company Information].*, [NAICS Codes].[NAICS Sector], [NAICS Codes].[NAICS Description] FROM [NAICS Codes] INNER JOIN [Company Information] ON [NAICS Codes].[NAICS Number] = [Company Information].[NAICS Code];

Maybe I have it set up wrong or something?

Thanks again for the help!
-Cavern
 
Okay.. I think I got this sorted out.. I had to add a new entry into the 'NAICS Codes' table though.. I added a code for '0' and set its entries to be something like 'Unknown'.. Then I ran a query to update all the null values in my 'Company Information' table to 0.. So It lists all the companies now..

-Cavern
 
I set it up like you suggested, except I used a Right Join instead of a left join.. And everything seems to be working fine..

I can't beleive that I forgot about the different types of join AGAIN! Its starting to become a bad habit with me....

Thanks for all the help guys, you're the best. Dont know what I'd do without ya, probably get fired. :)
 

Users who are viewing this thread

Back
Top Bottom