JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I have the following working code in Excel that inserts a record into an Access database table.
Can it be re-written so that there is no open/close of the database application?
TIA,
Jack
I have the following working code in Excel that inserts a record into an Access database table.
Can it be re-written so that there is no open/close of the database application?
Rich (BB code):
Sub New_Job_DB_Test()
Dim r As Range: Set r = wAdd_Job.Range("New_Job_Record")
With CreateObject("Access.Application")
.OpenCurrentDatabase Database_Params(3)
.Run("Return_Job_ID", r.Cells(1, 1).Value, wAdmin.Range("Client_ID").Value, r.Cells(1, 3).Value, r.Cells(1, 4).Value, r.Cells(1, 5).Value, r.Cells(1, 6).Value)
.CloseCurrentDatabase
.Quit
End With
Set r = Nothing
End Sub
TIA,
Jack