OK, I’m stumped. I’ve been spending an embarrasing number of hours trying to get around this problem. I have three option buttons on what I will call UserForm2. Depending on which option button is selected, different sample text should appear on UserForm1. Unfortunately, what appears in this text field is very random. I could cycle through the option buttons, displaying UserForm1 after selecting each one, and get different results each time.
I have tried putting the code to populate the text box in the Click event of the option buttons (which is what I have in the attached example), and have put it in the initialize event of UserForm1, and have even tried putting it in both.
I have tried populating the list box by explicitly defining the Text and/or Value property of the text box (which is what I have in the attached example), and have tried populating it with a variable. I have the same results each time.
I have added some labels to UserForm2 to make sure that the Boolean variables are being set properly. They serve no other purpose.
PLEASE NOTE: The attached example is a crude recreation of a much larger project. I know there are probably a lot of things I could do to make it better, but it is just for the purpose of illustrating the issue mentioned above.
To run the form, click RunForm. Choose an option button. Then click CommandButton1 to view the result in the text box. Clicking User Document should populate the text box with the text “Month YYYY”. Clicking User Document option button should populate the text box with “Month DD, YYYY”. Clicking the Technical Document option button should populate the text box with “month DD, YYYY”.
P.S. I use the DATE method to format user input based on a variable set from the option buttons. This picks up the variable value just fine and formats the text correctly every time. I just can’t get the stinking sample text to show up properly.
I would be truly greatful for any help!!
Troy