I was given a project in which I must take a very inefficient method of gathering, organizing, and entering data, and make it work.
That being said, here is what I am faced with:
I have an Excel file that I must input into the master table. The Excel file, temporary table, and master table are all structured the same. The table is structured like this:
PART_NUMBER |
OCT13 |
NOV13 |
DEC13 |
1234567890 |
1000 |
1000 |
1000 |
1234567891 |
2000 |
2000 |
2000 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
The Excel input form was designed to handle 100 part numbers, even if a particular input only required 1 or 2 part numbers. Therefore, there are a whole lot of zeros that must be stripped before I can work with it.
The best process I can think of is:
- Make an input form with tblTEMP as the Recordset (Done)
- Create a button to execute TransferSpreadsheet into a temporary table (Done)
- Strip the records with "0" part number (DELETE * FROM tblTEMP WHERE PART_NUMBER = '0')
- Update the master table with results that are left
So far I have this code, but I seem to be getting the syntax wrong:
Code:
UPDATE tblMASTER SET OCT13 = & Me.OCT13 &
I am also needing to set up a For loop, something like:
Code:
For Each PART_NUMBER in tblTEMP, run the update query
Thanks for any help you can provide! If you have any other ideas on how to input this data, please let me know.