dfenton21
03-24-2009, 04:13 AM
I have a question regarding forms in VBA. I’m almost certain this can be done, but I am still a notice.
I have a form with an input box for a staff id number. There is another hidden sheet with a list of staff names in column A, and the corresponding staff numbers in column B.
I need a macro to display another form with a list box populated by the names and numbers (sorted by name), allow the user to select one staff name, and then insert the corresponding staff number in the input box of the first form. Ideally, I would also like the user to be able to simply type in the staff number if they know it, rather then going through the “Lookup number” button.
Secondly, it is possible to validate a manual entry into that box. The entry should be a numerical value not greater than 6 digits.
Thanks in advance.
I have a form with an input box for a staff id number. There is another hidden sheet with a list of staff names in column A, and the corresponding staff numbers in column B.
I need a macro to display another form with a list box populated by the names and numbers (sorted by name), allow the user to select one staff name, and then insert the corresponding staff number in the input box of the first form. Ideally, I would also like the user to be able to simply type in the staff number if they know it, rather then going through the “Lookup number” button.
Secondly, it is possible to validate a manual entry into that box. The entry should be a numerical value not greater than 6 digits.
Thanks in advance.