Hi, short story is I need to retain the value in the ComboOffice box (until it's changed) and I'm getting confused and going in circles
Long story:
Userform (frmInput) with ComboOffice - the values for the combo are loaded on workbook open and don't change.
The form loads on workbook open.
The user is to pick an office from the first combobox, the value returned is the 2nd column, which is a number. (so user sees name in box, value is number)
(This is all working)
The user then picks 1 of 3 option buttons.
button 1 shows ComboNames and loads manager names to ComboNames
button 2 shows ComboNames and loads worker names to ComboNames
button 3 doesn't show ComboNames at all
Then user clicks command button (frmButton1)
(there is error handling if they don't pick a button)
it pulls the data and hides the form (frmInput.Hide)
(because I only hide and don't unload, I thought it would retain value and this is confusing me, too)
There is a command button (cbReloadfrmInput) on the worksheet where the data is placed that allows user to show form and make a different selection. Generally user will only change names and not office.
The ComboOffice continues to show the name of the office that was previously chosen (because I don't clear it), but the office value is now gone. I'd like to retain and continue to use the same value until they make another choice. But I'm confused on where I store that value and when I need to call it.
There is a change event for ComboOffice, and click events for each button.
The value is used as a parameter in SQL query and the first time it's picked no problem, but then value is lost and so am I.
Bookmarks