tomsov
New Member
- Joined
- Mar 31, 2017
- Messages
- 24
This one is a bit complicated to explain so I'll do my best:
I have an index (main) userform that displays open orders using a set of listboxs. When I enter either a part number or description into a textbox, listbox1 displays a set of results that are exact matches and wildcard matches - any result can be selected and it will populate listbox2 showing a list of customers that have open orders of that specific part. So at the moment a description can be entered such as "Mk2 Bonnet", listbox1 shows every entry from a database containing "Mk2","Bonnet" etc - the user clicks on the appropriate part and this populates listbox2. Listbox2 shows all the customers that have the Mk2 Bonnet on order.
So, all this works great - but it takes up a load of screen space on some of the terminals that have small screens.
What I'd like to do is to have Listbox1 popup over the top of everything to show the relevant data when the user enters the part number or description into the textbox.
My first thought was to use inputbox and populate it with the result from the search routine, but then thought about creating another 'popup' userform that is called from the index userform when the search is performed.
So far I can make the second userform popup, but am struggling to set the focus on it from the code within the index userform (the main controlling userform) so that the listbox on the popup userform is always blank. I think it may be an issue with passing data from one form to another?
The error produced is "Error 424, Object Required" which seems like it makes sense, just I can't seem to find out how to pass the results from userform1 to userform2 and run code within userform1 that shows results on userform2.
Hope all this make sense! Below is a screenshot of what I'm trying to achieve (but with a populated userform2). Thanks!
I have an index (main) userform that displays open orders using a set of listboxs. When I enter either a part number or description into a textbox, listbox1 displays a set of results that are exact matches and wildcard matches - any result can be selected and it will populate listbox2 showing a list of customers that have open orders of that specific part. So at the moment a description can be entered such as "Mk2 Bonnet", listbox1 shows every entry from a database containing "Mk2","Bonnet" etc - the user clicks on the appropriate part and this populates listbox2. Listbox2 shows all the customers that have the Mk2 Bonnet on order.
So, all this works great - but it takes up a load of screen space on some of the terminals that have small screens.
What I'd like to do is to have Listbox1 popup over the top of everything to show the relevant data when the user enters the part number or description into the textbox.
My first thought was to use inputbox and populate it with the result from the search routine, but then thought about creating another 'popup' userform that is called from the index userform when the search is performed.
So far I can make the second userform popup, but am struggling to set the focus on it from the code within the index userform (the main controlling userform) so that the listbox on the popup userform is always blank. I think it may be an issue with passing data from one form to another?
The error produced is "Error 424, Object Required" which seems like it makes sense, just I can't seem to find out how to pass the results from userform1 to userform2 and run code within userform1 that shows results on userform2.
Hope all this make sense! Below is a screenshot of what I'm trying to achieve (but with a populated userform2). Thanks!