Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / August 2006

Tip: Looking for answers? Try searching our database.

pass value from a text box to a bound combobox and force AfterUpdate Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
thebridge - 18 Aug 2006 00:16 GMT
Hi,
When I pass a value from MyTextBox to MyComboBox using:

Me.MyTextBox = Me.MyComboBox

It does Not trigger the AfterUpdate Event of the ComboBox

I need it to! Any Suggestions??

I have tried: copy and pasting by but that creates a problem

   Me.MyTextBox = BarCodeData$ 'passes the variable value to MyTextBox
   Me.MyTextBox .SetFocus
   Me.MyTextBox .SelStart = 0
   Me.MyTextBox .SelLength = Len(Me.MyTextBox ) + 1
   SendKeys "^c" 'copies the value of of MyTextBox

as soon as I add the below line, it no longer copies the value in
MyTextBox
   Me.MyComboBox.SetFocus

The onEnter Event of MyComboBox has the following code that works fine.

Private Sub cboLookupPart_Enter()

  Me.MyComboBox.SetFocus
   Me.MyComboBox.SelStart = 0
   Me.MyComboBox.SelLength = Len(Me.MyComboBox.Text)
   SendKeys "^v"

End Sub

If I ran all the code above, all works but the "Copy" and thus anything
that may be in the clipboard is pasted into MyComboBox, and the
AfterUpDate of MyComboBox triggers.

I know that there are compelling reason NOT to use the SendKeys but I
was just trying something

What I'd really like to do is eliminate MyTextBox and pass the Variable
directly to MyComboBox:

Me.MyComboBox= BarCodeData$

And have it force the AfterUpdate Event of MyComboBox

Eagerly awaiting suggestions!

Thank you,
Robert Bloomfield
Jeff Boyce - 18 Aug 2006 00:30 GMT
Robert

If you want to set [MyComboBox], you'd need to reverse that equation... that
is, you want

   MyComboBox to be = MyTextBox

If you want the AfterUpdate event of MyComboBox to be triggered, you can
call it in code:

   Call MyComboBox_AfterUpdate()

Why?  As in why do you need to "load" a combo box?

I ask because there may be something you want to accomplish by doing this,
and newsgroup readers may be able to offer another approach.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hi,
> When I pass a value from MyTextBox to MyComboBox using:
[quoted text clipped - 46 lines]
> Thank you,
> Robert Bloomfield
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.