View Single Post
 
Old 09-19-2020, 07:59 PM
4Star1957 4Star1957 is offline Windows 10 Office 2016
Novice
 
Join Date: Sep 2020
Posts: 12
4Star1957 is on a distinguished road
Default

Hi Guessed thank you for your reply. I will attempt to use the combobox - only one selection will be required. The selections will be the type of contract ie either "full time", "part time" or "casual". I have set up docvariables in a template. I have also set up 3 userforms each containing the variables required for the type of employment. The user will open the template and a userform is presented with a combobox where they select the type of employment... then I want to call the correct userform. I know that I will need to hide and show userforms, I know of the code to do that. I also know the basic code to set up a combobox. What I'm not sure of is how to layout the code.

If combobox1.value = full time Then
I know here I'm to hide the current userform and show the next one
but I'm not sure of how the code should be set out.

I have started this project using multitab userform - but it more than likely will get too big - because there could actually be 6 different types of employment.

This is the code I have behind the combobox.

Sub ComboBox1_Change()
With ComboBox1
.AddItem "Maximum Term Full Time"
.AddItem "Maximum Term Part Time"
.ListIndex = 0
End With

If ComboBox1.Value = "Maximum Term Full Time" Then
UForm1.Hide
UForm2.Show
End If
If ComboBox1.Value = "Maximum Term Part time" Then
UForm1.Hide
UForm3.Show
End If

End Sub

I am hoping you give me some advice as to how to set this up so it works. Currently when I run this code it shows the userform - but there is nothing in it.

Last edited by 4Star1957; 09-19-2020 at 08:28 PM. Reason: Wanted to show the code I tried - but it does not work.
Reply With Quote