I need to set the enabled = False on the child combo box if there are no valid rows from the query. see vba below.
thks in advance.
Expand|Select|Wrap|Line Numbers
- Private Sub ProjCombo_AfterUpdate()
- Dim sAcctSource As String, sDeptSource As String
- '
- sAcctSource = "SELECT ComboMaster.AcctID, ComboMaster.BUnitID, ComboMaster.ProjID, " & _
- "ComboMaster.ActivityID FROM ComboMaster WHERE (((ComboMaster.AcctID) Is Not Null) " & _
- "AND ((ComboMaster.BUnitID)=""" & Me.ProjCombo.Column(3) & """) AND " & _
- "((ComboMaster.ProjID)=""" & Me.ProjCombo.Value & """) AND " & _
- "((ComboMaster.ActivityID)=""" & Me.ProjCombo.Column(2) & """))"
- Me.AcctCombo.RowSource = sAcctSource
- Me.AcctCombo.Requery
it's here where i check the listcount of acctcombo to determine if i need to hide account combo. problem is that the listcount returns 1 regardless if there are no rows returned by query or 1 valid row.
End Sub