You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
The module that I am working on is meant to update an Access db by keying off of multiple fields in an excel sheet that will be variable. I am fine with the db connection and creating a sql string in VBA though I do not know the best way to either loop/execute a varying number of similar update statements. I have included a copy of the code that I have been working with below (some parts of my experiments are included) Thanks and please let me know if i need provide any futher information.
Sub UpdateSomeRecordsADO()
Dim cnn As ADODB.Connection
Dim UpdCommand As ADODB.Command
Dim dbstrg As String
Dim UpdStrg As String
Hi aabnormal,
So you wish to extract data from Excel and enter it into an MS Access database. The database connection code is fine. I can see you wish to extract it from within an MS Excel spreadsheet using the Range, however it's not clear what cells you wish to extract it from.
If you write what you are trying to do in pseudo code i will post the actual VBA code implementation.