I am getting the following error on this pretty basic line of code hope someone can help.
Object Variable or With block variable not set
'MS Access VBA Code

VB Code:
  1. Private Sub Form_Load()
  2. Dim rs As Recordset
  3. Dim cnn As Connection
  4. [U]cnn = CurrentProject.Connection[/U]
  5. rs.Open "SELECT * from Employees", cnn, , , adCmdText
  6. Me.lstEmpStates.RowSourceType = ValueList
  7. While Not rs.BOF And Not rs.EOF
  8. 'Me.lstEmpStates.Additem
  9. rs.MoveNextWend
  10. End Sub