ListBoxes

EndersG

Registered User.
Local time
Today, 12:34
Joined
Feb 18, 2000
Messages
84
I was wondering if there is an event I could invoke in MS Access that would check to see if there is any data in a list box once the form is loaded. I have a listbox whose underlying query changes from day to day based on a Date() criteria. There can be 5 records one day, 12 records another day and no records the next day. If there is no data in the listbox, I would like the listbox and a particular command button (cmd1) to be disabled. Can this be done?
 
How about putting a dcount in the onopen event of the form which checks the underlying query for the listbox and if the answer is 0 then run code to hide the button . . .
 
You may also try this code in the open statement.

If list1.ListCount = 0 Then
cmdButton1.Enabled = False
End If

e_kimball@yahoo.com
 

Users who are viewing this thread

Back
Top Bottom