how to take the input value of a msoControlEdit control 
Author Message
 how to take the input value of a msoControlEdit control

I have created a custom commandbar. In this commandbar, I have set a control
as msoControlEdit with a macro attached to it.

How to take the input in this msoControlEdit box and pass it to the macro
for processing?

Appreciate any help! Thank you.

Patrick Choi



Mon, 28 Feb 2005 12:54:18 GMT  
 how to take the input value of a msoControlEdit control
This kind of thing worked ok for me:

Option Explicit

Sub testme01()
    Dim ctrl As CommandBarControl
    Call deleteCB
    Set ctrl = Application.CommandBars(1).Controls.Add _
            (Type:=msoControlEdit, temporary:=True)
    With ctrl
        .Caption = "edittest"
        .OnAction = ThisWorkbook.Name & "!showme"
    End With
End Sub

Sub deleteCB()
    On Error Resume Next
    Application.CommandBars(1).Controls("edittest").Delete
    On Error GoTo 0
End Sub

Sub showme()
    MsgBox CommandBars.ActionControl.Text
End Sub

Quote:

> I have created a custom commandbar. In this commandbar, I have set a control
> as msoControlEdit with a macro attached to it.

> How to take the input in this msoControlEdit box and pass it to the macro
> for processing?

> Appreciate any help! Thank you.

> Patrick Choi

--

Dave Peterson



Tue, 01 Mar 2005 08:36:33 GMT  
 how to take the input value of a msoControlEdit control
Dave,

Thank you so much for your solution. It works just perfect.

Patrick Choi

Quote:
> This kind of thing worked ok for me:

> Option Explicit

> Sub testme01()
>     Dim ctrl As CommandBarControl
>     Call deleteCB
>     Set ctrl = Application.CommandBars(1).Controls.Add _
>             (Type:=msoControlEdit, temporary:=True)
>     With ctrl
>         .Caption = "edittest"
>         .OnAction = ThisWorkbook.Name & "!showme"
>     End With
> End Sub

> Sub deleteCB()
>     On Error Resume Next
>     Application.CommandBars(1).Controls("edittest").Delete
>     On Error GoTo 0
> End Sub

> Sub showme()
>     MsgBox CommandBars.ActionControl.Text
> End Sub


> > I have created a custom commandbar. In this commandbar, I have set a
control
> > as msoControlEdit with a macro attached to it.

> > How to take the input in this msoControlEdit box and pass it to the
macro
> > for processing?

> > Appreciate any help! Thank you.

> > Patrick Choi

> --

> Dave Peterson




Tue, 01 Mar 2005 11:19:23 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Control value on a report - taken from a Combo box on a form

2. Finding a Value/Controlling input

3. Finding cell by it's value and taking the value of its relative cell

4. How to control user input into cells rather than using input dialog boxes

5. Help changing control values based on other control values please

6. set control value = to subform control value

7. Input box method - value for input of date

8. give value to one control(textbox) from value of another control (combo) using a macro

9. Returning a value in a control based on value in another calculated control

10. Trouble adding subreport control value witha main report control value


 
Powered by phpBB® Forum Software © phpBB Group