-
Solved: Help with Commad bar
I have the following:
[VBA]
With cb.Controls.Add(Type:=msoControlButton)
.BeginGroup = True
.Caption = "Find Synergi case #"
.TooltipText = "Find Synergi case # - Globally"
.Style = msoButtonCaption
.OnAction = "FindCaseNumber"
End With
With cb.Controls.Add(Type:=msoControlEdit)
.Text = ""
.Tag = "FindSynergiCaseNumber"
.TooltipText = "Find Synergi case # - Globally"
End With
[/VBA]
What I am trying to do is to read what was typed into the Control Edit object, however, I am failing miserably! I thought that I can read it by
[VBA]
Sub FindCaseNumber()
Dim SynergiCaseNumber As CommandBarControl
Set SynergiCaseNumber = CommandBars("ProcessSafetyTotals").FindControl(, , "FindSynergiCaseNumber")
MsgBox SynergiCaseNumber.Text
End Sub
[/VBA]
I am always getting blank.... Is there a way that I can read the control's text?
-
Are you pressing enter after adding text to the edit box? If not, you will see that the contents get cleared when you click the other button. Is there a reason for not assigning the macro to the edit box itself?
-
Thank you Aflatoon, once I pressed Enter, my control gets the assignment.
Not assigning to the control....., well, I feel embarassed now, I never thought of it! I guess that I will assign it to the control so when the user press the Enter key, it will use it as the parameter.
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules