I'm having trouble copying data from one Access table to another. Any help would be appreciated.
Private Sub Command1_Click()
Set m_conn = New ADODB.Connection
Set IMHIST = New ADODB.Recordset
m_conn.ConnectionString = ...
m_conn.Open
With m_IMHIST
.ActiveConnection = m_conn
.CursorType = adOpenDynamic
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
.Source = "INSERT INTO IMHIST(SELECT * FROM IMLN)"
.Open
End With
End Sub
I keep getting a syntax error
Private Sub Command1_Click()
Set m_conn = New ADODB.Connection
Set IMHIST = New ADODB.Recordset
m_conn.ConnectionString = ...
m_conn.Open
With m_IMHIST
.ActiveConnection = m_conn
.CursorType = adOpenDynamic
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
.Source = "INSERT INTO IMHIST(SELECT * FROM IMLN)"
.Open
End With
End Sub
I keep getting a syntax error