Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
In a userform with rows of comboboxes and textboxes, after exiting a textbox, if there is nothing in it, and there is nothing in a combobox to it's immediate left then "nothing", else do "this". What I'm trying to do is with the ActiveControl name, I can ID the cbx to the left, then check the cbx's value, and do this or that. This is what I wrote, but I'm stumped. With frm_tech_lv Dim NameOfActiveControl As String NameOfActiveControl = ActiveControl.Name Dim CbxLvCtrlNm As String CbxLvCtrlNm = "frm_tech_lv.cbx_tpl_" & Mid(NameOfActiveControl, 9, 4) & "_lc" & Right(NameOfActiveControl, 1) Dim cbx As ComboBox Set cbx.Name = CbxLvCtrlNm If ActiveControl.Value = "" And cbx = "" Then Else MsgBox "From time needed." Exit Sub End If End With Any and all suggestions would be greatly appreciated. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe
With frm_tech_lv Dim NameOfActiveControl As String Dim CbxLvCtrlNm As String Dim cbx As Control NameOfActiveControl = ActiveControl.Name CbxLvCtrlNm = "frm_tech_lv.cbx_tpl_" & Mid(NameOfActiveControl, 9, 4) _ & "_lc" & Right(NameOfActiveControl, 1) Set cbx = me.controls(CbxLvCtrlNm) If ActiveControl.Value = "" And cbx.value = "" Then Else MsgBox "From time needed." Exit Sub End If End With BigPig wrote: Hi All, In a userform with rows of comboboxes and textboxes, after exiting a textbox, if there is nothing in it, and there is nothing in a combobox to it's immediate left then "nothing", else do "this". What I'm trying to do is with the ActiveControl name, I can ID the cbx to the left, then check the cbx's value, and do this or that. This is what I wrote, but I'm stumped. With frm_tech_lv Dim NameOfActiveControl As String NameOfActiveControl = ActiveControl.Name Dim CbxLvCtrlNm As String CbxLvCtrlNm = "frm_tech_lv.cbx_tpl_" & Mid(NameOfActiveControl, 9, 4) & "_lc" & Right(NameOfActiveControl, 1) Dim cbx As ComboBox Set cbx.Name = CbxLvCtrlNm If ActiveControl.Value = "" And cbx = "" Then Else MsgBox "From time needed." Exit Sub End If End With Any and all suggestions would be greatly appreciated. Thanks. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dave,
Thankyou! You're a life saver! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ActiveControl problem | Excel Discussion (Misc queries) | |||
ActiveControl again | Excel Programming | |||
ActiveControl | Excel Programming | |||
Calendar Control & ActiveControl | Excel Programming | |||
userform1.activecontrol.name | Excel Programming |