PDA

View Full Version : Excel VBA Access



ruci1225
03-29-2011, 03:35 PM
I have a workbook in excel with student data, is there a way to link the spreadsheet to an access database and perform a search?
For example In Excel, I have student information, name, phone number... etc and in access I have call data, I would like to perform a Vlookup(or something similar) to tell me if the student in excel is found in the access database (by phone number match) and if so, bring back the last date time the student was called. I currently have this working in excel using vlookup but rather than pasting the large data into excel into another worksheet, I would like to directly search the database. Is this possible?

fmcti
03-29-2011, 05:39 PM
You can probably perform a SQL query with VBA code in the excel file to pull the correspondent data from the access to the excel file if there is any.
You'd better attach a sample of your access database and the excel file you are talking about.

nepotist
03-29-2011, 05:40 PM
I would actually import the excel data to access, create a relationship between tables and write a simple query and link it back to excel. Doing this way the data would automatically update to excel containing calls made by a student.

If you would actually like to do it your way, would you mind posting a sample of excel and access data with dummy values so that it will help us to assist you better

Kenneth Hobs
03-29-2011, 06:18 PM
ADO is a method that I might use. For examples see: http://www.erlandsendata.no/english/index.php?t=envbadac