CODE "Can someone help"
When I run this code I get an error message " A runSQL action requires an argument cosisting of an SQL statement"
Here is the code;
Dim StrSql As String
Dim id As Integer
myid = Me.my_list.Column(0)
StrSql = "SELECT Count (maintable.id) FROM maintable WHERE maintable.id= " & myid & ";"
DoCmd.SetWarnings False
DoCmd.RunSQL StrSql
MsgBox StrSql
DoCmd.SetWarnings True
I don't think that anything is wrong with my sql statement. btw I'm doing a count for the ID's. Thanks.
When I run this code I get an error message " A runSQL action requires an argument cosisting of an SQL statement"
Here is the code;
Dim StrSql As String
Dim id As Integer
myid = Me.my_list.Column(0)
StrSql = "SELECT Count (maintable.id) FROM maintable WHERE maintable.id= " & myid & ";"
DoCmd.SetWarnings False
DoCmd.RunSQL StrSql
MsgBox StrSql
DoCmd.SetWarnings True
I don't think that anything is wrong with my sql statement. btw I'm doing a count for the ID's. Thanks.