pinstripe
Programmer
- Dec 27, 2004
- 52
i have a listbox where is one column!
then i have button which has a status diabled
now with the code below i wanna to enable button if there is any data - it remains disabled if there is no data
but it is not working -- i have status in any case enabled or enabled- Why?
Private Sub Form_Load()
If IsNull(DLookup("[BOM Level]", "[BOM L2]", ("[BOM Level]= '" & Me.[List97].Column(0) & "'"))) Then
nextlevel.Enabled = False '' remains disabled
Else
nextlevel.Enabled = True
End If
End Sub
then i have button which has a status diabled
now with the code below i wanna to enable button if there is any data - it remains disabled if there is no data
but it is not working -- i have status in any case enabled or enabled- Why?
Private Sub Form_Load()
If IsNull(DLookup("[BOM Level]", "[BOM L2]", ("[BOM Level]= '" & Me.[List97].Column(0) & "'"))) Then
nextlevel.Enabled = False '' remains disabled
Else
nextlevel.Enabled = True
End If
End Sub