Codeeachday
New Member
- Joined
- Jan 29, 2013
- Messages
- 1
So I am trying to type data into cell B9535 in excel and use an ActiveX submit button to have this data appended to a table called 'tblImport' in Access to the Field called 'SalesOrderID'
here is the code:
Private Sub Submit_Click()
Dim dbConn
Set dbConn = CreateObject("ADODB.Connection")
With dbConn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Open "db path here"
End With
End Sub
Private Function InsertRecord()
Dim strSQL As String
strSQL = "Insert INTO tblImport(SalesOrderID) VALUES ('=Range" 'B''9535'"')"
dbConn.Execute strSQL
End Function
Private Sub Form_Terminate()
dbConn.Close
Set dbConn = Nothing
End Sub
There are no errors when I compile but nothing happens.
no data is appended onto the access table.
here is the code:
Private Sub Submit_Click()
Dim dbConn
Set dbConn = CreateObject("ADODB.Connection")
With dbConn
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Open "db path here"
End With
End Sub
Private Function InsertRecord()
Dim strSQL As String
strSQL = "Insert INTO tblImport(SalesOrderID) VALUES ('=Range" 'B''9535'"')"
dbConn.Execute strSQL
End Function
Private Sub Form_Terminate()
dbConn.Close
Set dbConn = Nothing
End Sub
There are no errors when I compile but nothing happens.
no data is appended onto the access table.