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:
Private Sub Form_Load() Dim rs As Recordset Dim cnn As Connection [U]cnn = CurrentProject.Connection[/U] rs.Open "SELECT * from Employees", cnn, , , adCmdText Me.lstEmpStates.RowSourceType = ValueList While Not rs.BOF And Not rs.EOF 'Me.lstEmpStates.Additem rs.MoveNextWend End Sub




Reply With Quote