Jun 6, 2001 #1 awhitsel Programmer Feb 22, 2001 80 US I want to be able to either disable or make invisible two command buttons on my form whenever there are no records showing in a list box. I believe that I had brought up this problem once before, but I getting back around to working on this part again.
I want to be able to either disable or make invisible two command buttons on my form whenever there are no records showing in a list box. I believe that I had brought up this problem once before, but I getting back around to working on this part again.
Jun 6, 2001 1 #2 LonnieJohnson Programmer Apr 16, 2001 2,628 US The VBA would be If ListBoxName.ListCount = 0 Then CommandButton.Enabled = True Else CommandButton.Enabled = False End If Where you put this will depend on how you are determining if there is anything in the listbox. ljprodev@yahoo.com ProDev MS Access Applications Upvote 0 Downvote
The VBA would be If ListBoxName.ListCount = 0 Then CommandButton.Enabled = True Else CommandButton.Enabled = False End If Where you put this will depend on how you are determining if there is anything in the listbox. ljprodev@yahoo.com ProDev MS Access Applications
Jun 7, 2001 #3 Aivars Programmer May 4, 2001 687 LV cmdButton.Enabled = lstListBox.ListCount > 0 If Column Heads of lstListBox is selected Yes then: cmdButton.Enabled = lstListBox.ListCount > 1 Aivars Upvote 0 Downvote
cmdButton.Enabled = lstListBox.ListCount > 0 If Column Heads of lstListBox is selected Yes then: cmdButton.Enabled = lstListBox.ListCount > 1 Aivars