Hi,
I am running a code
Public Sub SQL()
Dim Name As String
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
strSQL = "SELECT Koondaurane.Person" & _
"FROM Koondaurane" & _
"GROUP BY Koondaurane.Person;"
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
Name = rs!Person
Set rs = Nothing
Set db = Nothing
End Sub
It works as long as I have one row in query but geting "missing operator" when there are more rows. What should I do to get all of the rows or to say what row to read?
I am running a code
Public Sub SQL()
Dim Name As String
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
strSQL = "SELECT Koondaurane.Person" & _
"FROM Koondaurane" & _
"GROUP BY Koondaurane.Person;"
Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
Name = rs!Person
Set rs = Nothing
Set db = Nothing
End Sub
It works as long as I have one row in query but geting "missing operator" when there are more rows. What should I do to get all of the rows or to say what row to read?