carpetbelly
Technical User
Hi,
I'm struggling with a bit of code in my database at the moment.
Unless it's a reference error I cannot see why it isn't working (tuesday morning blues otherwise hehe)
I just cannot get the .additem to work. It isn't even an option to do on my combo box.
I'm struggling with a bit of code in my database at the moment.
Unless it's a reference error I cannot see why it isn't working (tuesday morning blues otherwise hehe)
I just cannot get the .additem to work. It isn't even an option to do on my combo box.
Code:
Private Sub form_load()
Set mc = New clsMonthCal
mc.hWndForm = mc.hWnd
Me.txtEndDate.Enabled = False
Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset
rst.Open "SELECT [StaffName] FROM tblStaff ORDER BY [StaffName];", cnn, adOpenStatic
rst.MoveLast
rst.MoveFirst
With Me.cmbName.Value = ""
Do
.additem rst![StaffName]
rst.MoveNext
Loop Until rst.EOF
End With
End Sub