January 30, 2020
Hi,
I have created a warehouse module that I am completing and have 22 listboxes that consist of 22 lines to click on
With this in Mind, I have created a Userform Activate that whenever an order has been raised a 'Check Order" userform and VBA code below selects all 22 listboxes and populates into various 22 lines in the text boxes.
However, if there is no data part lstlookup, it indicates Run-time error 380, could not set the selected property. Invalid property value.
is there a VBA coding that if there was no Data or Value in any listbox to continue with the opening of the userform.
Private Sub Userform_Activate()
'Dim arrItems() As String
Dim bRB As MSForms.ReturnBoolean
lstLookup.Selected(0) = True
lstLookup_DblClick bRB
lstLookup1.Selected(0) = True
lstLookup1_DblClick bRB
I have put a "Comma" in front of lstLookup1 to verify if there was no data in this listbox and sure enough debug indicates lstLookup2
'lstlookup1.Selected(0) = True
'lstlookup1_DblClick bRB
Thanks
Steve
January 30, 2020
Thanks Phil,
When you open
Password:Betty
Passcode:1111
Hit ALT+F11
Under form - frmCreatePickTicket2 --RUN
It will then debug
Userform relates to TAB(Sheet12) CheckOrder. There is no data from ID 7 to 22
need to automatically after running frmorder userform to completion run Checkorder.
Thanks
October 5, 2010
Hi Steve,
If there's nothing in the list you'll get this error. To check if there's nothing in the list you'll need to do something like
If lstLookup6.ListCount = 0 Then
'List is empty
Else
'List has items
End if
But, why use ListBoxes? Why not just use Text Boxes and avoid this hassle?
Regards
Phil
1 Guest(s)