Using an Excel Cell reference with Access ADO
I'm still a bit of a novice when it comes to VBA and I am completely stuck
and puzzled within Chapter 20- Data Access with ADO
As part of the tutorial on 'Inserting, updating, and deleting records with
Plain Text SQL in Microsoft Access' it provides the code for inserting a
new record into access.
See below
objCommand.CommandText = "INSERT INTO Shippers(CompanyName, Phone) " & _
"VALUES('Air Carriers', '(205) 555-1212');"
I am stuck because I can not figure out how to use an excel cell reference
instead of using a set text value, for instance instead of inserting the
words 'Air Carrier' as the Company Name I want to be able to specify an
excel range such as range("A1") which will contain a name.
|