UtterAccess Discussion Forums
  UtterAccess Home  | Forums Index  | Search  | Links DB  | FAQs   
Microsoft® Access help forums plus Excel, Word, Outlook®, Visual Basic®, SQL Server®, Office online and... many more!

Access UtterAccess!
New? Welcome!
Join UA here!

Members Login


Password


Remember me!


Search The Database

More Links

  UtterAccess Links
  Link to UtterAccess
  Call UtterAccess Home
  Add UA to Favorites

Quick Jump



UA Recommended

Access Team Blog

UA Recommended

UA's own ScottGem
      and datAdrenaline!

Servers tuned by
Vaultechnology
msoControlEdit Text Value

msoControlEdit Text Value  Version: 2003 (11.0)

Posted on 06/21/08 10:34 PM
Posted by ALMU3YN - Utter Access Addict
Posts: 147 -

Forum: Access Code Archive
• Edit
• Reply
• Quote
• Quick Reply
• Print this post
• Bookmark Post
• Notify Moderator

• Top of page
Great thanks to Bernie Brooks for his kind replies & support.
Try this code to get the Text Value of the msoControlEdit CommandBarControl.
Code:


Dim CB As CommandBar
Dim Cbc As CommandBarControl
'''link the open event to function CreateBar...

Function CreateBar() '''' creates Commandbar

On Error Resume Next
Application.CommandBars("thisBar").delete

Set CB = CommandBars.Add(NAME:="thisBar", Position:=msoBarTop, MenuBar:=False, Temporary:=True)
CB.Protection = msoBarNoMove

Set Cbc = CB.Controls.Add(Type:=msoControlEdit)
With Cbc
'''enter text in msoControlEdit and press enter, then function getText runs.
.OnAction = "getText"
.Width = 100
.Caption = "TextonBar" '''we use the caption name to referece msoControlEdit control
.Enabled = True
End With

CB.Visible = True
End Function

''''' get msoControlEdit text value
Function getText()
Dim str1 As String


str1 = CommandBars("thisBar").Controls("TextonBar").Text


msgbox(str1)
End Function




--------------------
There is only one religion, though there are a hundred versions of it. George Bernard Shaw.

Page Jump
Pages: 1

Navigate
Post List
Previous thread Previous
Next thread Next

Thread Options & Info
• Threaded
• Print Thread

• 1256 Thread views

Page Jump
Pages: 1