PDA

View Full Version : Passing combobox value on one user form to another user form



smartphreak
10-05-2010, 01:20 AM
Hey all,

I have tried to upload my sample workbook...




I have a working script to run adding payments... it performs a check of the details entered and only runs if the criteria i want are there.

The problem I have is if the "Debtor Code" is not correct I want to open another userform with the option to try enter the code again in a textbox or select a debtor code/name from a combo box.

I thought about running all the code in the module and assigning public variables but that doesnt seem to work as I need the result of a combobox selection to be carried to the next userform...

Any help?

Thanks

Tinbendr
10-06-2010, 09:57 AM
Question: Why don't you go ahead a add the Debtor dropdown to ssForm_AddReceipt form? Seems redundent to me.

But to answer you question, pass the value to the first form BEFORE you close the second.


Private Sub ssButton_DebtorCode_Click()
ssTextBox_DebtorCode = ssComboBox_WrongCode
Unload Me
End Sub