Convert text to ID number of another table

daze

Registered User.
Local time
Today, 21:50
Joined
Aug 5, 2009
Messages
61
I have this problem:

I want to import customers’ names, emails and their office code into my customers table.

Names & emails are fine (text), but in my database office field is number as lookup to OfficeID in office table.

So now I’d like to have formula or VBA code to check text filed of office (that was imported) in tempTable against records in office table and return OfficeID number in each record.

When I tried putting numbers (OfficeID) instead text in office code of tempTable I managed to imported in customers table without errors and now it shows text in it (I'm using drop-down menu).
 
Solved!

I imported data from excel spreadsheet as they are (all text)it temp table, then did query on that temp table to compare imported data in office field with office table data.
I then added ID field of office table that gave me ID number of matching office.

Then I ran append query from temp table into customers table with names and emails of customers (as text) and officeID (temp table) into office field (customers table) as number...

I was certain it could be done, just was unsure how to proceed.
 

Users who are viewing this thread

Back
Top Bottom