Merge two Access tables
-
Wednesday, July 11, 2012 10:35 PM
Hi,
I'm looking for a VBA solution in Access to emulate a VLOOKUP in Excel. I have two tables with a common key field. From the first table, I want to look up the key value in the 2nd table and place the value from the 2nd table into the field of the same name in the first table. I need to do this for all records in the first table. Any help would be appreciated. Thanks!
Howard
Howard Freedman
All Replies
-
Wednesday, July 11, 2012 11:38 PM
Might I suggest a simple update query? Create a relation btw the 2 tables on their common key and then you should have no problem pushing the desired data intothe appropriate field. If you must it can be ported to VBA.
Daniel Pineault, 2010 Microsoft MVP
http://www.cardaconsultants.com
MS Access Tips and Code Samples: http://www.devhut.net- Edited by Daniel Pineault1MVP Wednesday, July 11, 2012 11:39 PM
- Marked As Answer by hfreedman Thursday, July 12, 2012 1:08 PM
- Unmarked As Answer by hfreedman Thursday, July 12, 2012 1:08 PM
- Marked As Answer by hfreedman Thursday, July 12, 2012 1:10 PM
-
Thursday, July 12, 2012 1:10 PM
Wow!!! I completely forgot about update queries. I'm so embarrased. Thanks so much and sorry to have taken your time. Thanks!
Howard
Howard Freedman
-
Thursday, July 12, 2012 1:38 PM
No reason to apologize for asking a question! Do you the number of times I've spent hours writting VBA code and all of a sudden realized it could have been done in minutes using a series of queries.
Glad I could help!
Daniel Pineault, 2010 Microsoft MVP
http://www.cardaconsultants.com
MS Access Tips and Code Samples: http://www.devhut.net

