PDA

View Full Version : Solved: Userform query



blackie42
06-06-2008, 07:50 AM
Hi,

Is it possible to make a textbox invisible or 'shaded out' by what is input in to a combobox on another? Have tried but can't seem to make it work.

e.g. userform1 - combobox1 value = X

blackie42
06-06-2008, 07:53 AM
sorry - can't even get the post to work!

on hitting cmdbutton userform2 opens and textbox2 isn't lit up.

If combox1 calue on userform1 is Y then textbox1 on userform 2 is lit up

thanks

Jon

RonMcK
06-06-2008, 10:14 AM
blackie42,

You change the 'visibility' of a userform object by toggling its .Enabled property. By way of example, I do this on a userform to disable the other buttons when the user clicks my Cancel button. My code for the UserForm includes the following. For your purposes, your code needs to look at the value in textbox2 (userform1) to decide whether Enabled = TRUE or FALSE for userform2's textbox1.
Private Sub cbCancel_Click()
cbBuild_AG_WS.Enabled = False
cbAGLessonLinks.Enabled = False
cbBuild_ST_WS.Enabled = False
cbSTLessonLinks.Enabled = False
'//Runs QueryClose with check for changes (save workbook?)
Unload UserForm1
ActiveWorkbook.Close Savechanges:=False
End Sub
HTH,

blackie42
06-06-2008, 10:55 AM
Thanks Ron - I'll give it a go on monday.

regards

Jon

RonMcK
06-06-2008, 11:01 AM
Jon,

Have a pleasant weekend. I gather you're on the other side of the pond.

Cheers!

blackie42
06-06-2008, 03:12 PM
Hi Ron,

Yes in the UK - hope you also have a good weekend.

regards

Jon

blackie42
06-06-2008, 03:16 PM
Oh BTW have been messing about at home with userforms and have managed to get it to work as i want with the enabled property.

much appreciated - every day I learn a little more thanks to this excellent board.

Jon