Greetings All...
I am currently using a recordset (Rs) to loop through a ListBox grab the selected items and add them to an Access BkEnd Linked Table
What I am trying to do is use a pass through query to send the data directly to the SQL server.
Here is the Rs that populates the access linked table
Code:
Dim Dbs As DAO.Database
Dim Rs As DAO.Recordset
Dim Item As Variant
Set Dbs = CurrentDb()
Set Rs = Dbs.OpenRecordset("TblTmpTktExtAccs")
For Each Item In Me.List14.ItemsSelected
Rs.AddNew
Rs!ItemsRequested = List14.ItemData(Item)
Rs.Update
Next
Rs.Close
Set Rs = Nothing
Below is a passthrough Query I am currently using with an INSERT Query
Code:
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.ConnectionString = strConnection
conn.Open
StrSQL = "INSERT INTO dbo.SalesNos (EmpID, EmpName, SalesTtl) " & _
"VALUES('" & EmpId & "', '" & EmpName & "', '" & Sales & "')"
conn.Execute StrSQL
conn.Close
Set conn = Nothing
What I'm trying to do is adopt the looping Rs to the passthrough or vice versa
As Always - Thank You for your help...