Hi Guys,
I am trying to figure out how to download data from MS SQL Server to MS Access FE to local table.
I have found the code here:
https://accessexperts.com/blog/2011/...easy-analysis/
code is:
Code:
Private Sub TestTemp() On Error GoTo ErrorHandler
Dim strSQL As String
Dim strTable As String
strTable = "tblTempTest"
'Delete the table if it exists
DoCmd.DeleteObject acTable, strTable
strSQL = "Select * INTO " & strTable & " FROM tblCustomers " & _
"Where CustomerState = 'ILL'"
Currentdb.Execute strSQL
'Insert more code here to do something with temp table
Exit Sub
ErrorHandler:
If Err.Number = 7874 Then
Resume Next 'Tried to delete a non-existing table, resume
End If
End Sub
But when i am trying to use it with linked table there is an error connected with "&" code. what is this and how can i use it in VBA?
thank you for helping,
Best Wishes,
Jacek