Insert data into access database from excel userform

  • Thread starter Thread starter sam
  • Start date Start date
S

sam

Hi All,

I have a userform in excel that users would use to submit their details once
they click "Submit" button on the form. I want the details to be stored in an
Access database. But most of the users dont have access installed on their
machine.

My question is, Is it somehow possible to insert data in Access database
through Userform if access is not installed on the local machine? We have a
network drive which is shared among all and Access is installed on my
machine.

Can this be done?

Thanks in advance.
 
hi Sam,
My question is, Is it somehow possible to insert data in Access database
through Userform if access is not installed on the local machine? We have a
network drive which is shared among all and Access is installed on my
machine.
Can this be done?
Yes, it is quite simple coding, you need a reference to the ADODB library:

Dim cn As ADODB.Connection
Dim Sql As String

Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OleDB.4.0;" & _
"Data Source=\\server\share\[path\]file.mdb"

SQL = "INSERT INTO [yourTable] (fieldList) " & _
"VALUES (valueList);"

cn.Execute SQL


If you don't like ADODB you can also use DAO.


mfG
--> stefan <--
 
Back
Top