I have a series of combo boxes where the rowsource is defined by the selection of the previous combo box.
The issue is that one of the combo boxes is a date that can either be one of the selectable items or a new date.
If it is a new date then I need the next combo box to detect that the drop down contains no data and so then use a different calculation for the rowsource.
The problem is that if I use ListCount then this will report Null if it is empty but I cannot seem to get an IF statement to respond to this event.
Where am I going wrong?Code:Private Sub txtDate_Change() txtLeader.RowSource = "SELECT [tblStaffDetails]![txtLName] & "", "" & [tblStaffDetails]![txtFName] & "" - "" & [tblStaffDetails]![txtFaculty] AS Staff FROM tblStaffDetails INNER JOIN tblActivityStaffDate ON tblStaffDetails.Staff_ID=tblActivityStaffDate.[Staff Member] WHERE (((tblActivityStaffDate.Activity)=Forms.frmNewRegister.txtActivity) And ((tblActivityStaffDate.dteDate)=Forms.frmNewRegister.txtDate)) ORDER BY tblStaffDetails.txtLName, tblStaffDetails.txtFName, tblStaffDetails.txtFaculty; " If txtLeader.ListCount = Null Then txtLeader.RowSource = "SELECT [tblStaffDetails]![txtLName] & "", "" & [tblStaffDetails]![txtFName] & "" - "" & [tblStaffDetails]![txtFaculty] AS Staff FROM tblStaffDetails INNER JOIN tblActivityStaffDate ON tblStaffDetails.Staff_ID=tblActivityStaffDate.[Staff Member] ORDER BY tblStaffDetails.txtLName, tblStaffDetails.txtFName, tblStaffDetails.txtFaculty; " End If txtLeader.Enabled = True If txtLeader.ListCount = 1 Then txtLeader.value = txtLeader.ItemData(0) txtLeader.Enabled = False End If End Sub