Forum Discussion
Combo Boxes not displaying Data
guitar713 Good question. When using the RowSource property, I had varying results for the first userform, but consistently could not get it to work for the second userform. Here's what I found (just through testing):
When using the Defined Names, URGENCY and UPDATYP, as the RowSource property for the two combo boxes on frmDataEntry, neither one worked.
When including the Sheet Name in the RowSource property, 'FORM SUPPORT'!$B$3:$B$5 or 'FORM SUPPORT'!URGENCY and 'FORM SUPPORT'!$C$3:$C$14 or 'FORM SUPPORT'!UPDATYP, it worked for the combo boxes on frmDataEntry, but the same method failed for the second userform, frmPeopleSoft, when using either 'FORM SUPPORT'!$D$3:$D$10 or 'FORM SUPPORT'!$SOFTNAME. I'm afraid I can't explain this inconsistent behavior, but I can say for sure that it's related to the Application Window being hidden. When I commented out the code to hide the Window, the RowSource property works as expected for all combo boxes on both userforms, by simply referencing the Defined Names.
Due to this inconsistent behavior when the Application Window is hidden, I would still recommend leaving the RowSource property blank for all combo boxes and populate them when the form is loaded. Also, you would still need to explicitly reference the Sheet Name or CodeName of the sheet in which the named ranges reside. So, in the case of frmDataEntry, use:
Private Sub UserForm_Initialize()
Me.cmbURGENCY.List = Sheet4.Range("URGENCY").Value
Me.cmbUPDATEType.List = Sheet4.Range("UPDATYP").Value
End Sub
Note: just a heads up, since your code is using frmPeopleSoft.Hide and frmDataEntry.Hide, the forms are still loaded when you go back to the "Excel View". This means that if you then jump over to the VBA editor and make a change to either of the combo boxes, then jump back over to the worksheet and click the "ECO" button to bring up the "Form View" again, the changes have not yet taken effect, as the forms were never unloaded / reloaded. This can lead to confusion, thinking the changes you made either worked or did not work. When making / testing changes in the development stages, you would need to use Unload frmPeopleSoft and Unload frmDataEntry to make sure the forms are being reloaded from scratch. You can do this in the Immediate Window of the VBA editor (View > Immediate Window or Ctrl+G).
I hope that helps!