i am new to vba programming i am trying to create a recordset in vba access 2007 my code is :
Dim cnn1 As ADODB.Connection
Set cnn1 = CurrentProject.Connection
Dim myRecordSet As New ADODB.Recordset
myRecordSet.ActiveConnection = cnn1
myRecordSet.Open "SELECT company FROM Table1", CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
i am facing an error saying that :compile error: expected: expression
please try to help me out where i have to change my code.