Still not sure about this.....
Hi im getting the following error, wrong number of arguements or invalid property assignment
any ideas
below is the code im using
Private Sub CommandButton4_Click()
Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stDB As String
Dim stCon As String
Dim i As Long
'Instantiate the ADO COM's objects.
Set cnt = New ADODB.Connection
Set rst = New ADODB.Recordset
'Pathway and name of the database
stDB = ThisWorkbook.Path & "\" & "supplier.mdb"
'Create the connectionstring.
stCon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & stDB & ";"
'Open the connection
cnt.Open stCon
'Open the recordset and You need to change to the
'correct table name.
rst.Open "customers", cnt, 1, 3, adCmdTableDirect, _
adLockReadOnly, adCmdTableDirect
'Add the new record and You need to change the name
'of the fields.
With rst
.AddNew
.Fields("Company Name") = combobox1_input
.Update
End With
'Close the recordset and close the connection.
rst.Close
cnt.Close
'Release objects from memory.
Set rst = Nothing
Set cnt = Nothing
Unload Me
End Sub