P
Peter
Hi all, I'm quite new to Access VBA (normally only work in Excel VBA).
I was hoping the below code would return a SELECT query...
Could anyone tell me why this code always returns with Run-time error
'2342' A RunSQL action requires an arguement consisting of an SQL
statement.?
And if you could tell me the solution that would be great!
Sub VBA_control_SQL_the_adventure_begins()
Dim table_name As String
Dim SQL As String
SQL = "SELECT tblstaff.[Firstname], tblstaff.Lastname " & _
"FROM tblstaff;"
DoCmd.RunSQL SQL
End Sub
Thanks for your help,
Peter
I was hoping the below code would return a SELECT query...
Could anyone tell me why this code always returns with Run-time error
'2342' A RunSQL action requires an arguement consisting of an SQL
statement.?
And if you could tell me the solution that would be great!
Sub VBA_control_SQL_the_adventure_begins()
Dim table_name As String
Dim SQL As String
SQL = "SELECT tblstaff.[Firstname], tblstaff.Lastname " & _
"FROM tblstaff;"
DoCmd.RunSQL SQL
End Sub
Thanks for your help,
Peter