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 / Modules / DAO / VBA / April 2006

Tip: Looking for answers? Try searching our database.

Return Value to Control on Current Record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CSSMepps - 02 Apr 2006 15:43 GMT
Hello,
I have some code written for a combo box On Change event on a form.  I would
like to have the result of that code returned to a control on the current
record (the one that triggered the On Change event).  

Here are the last two lines of my code:
Me.txtTest.SetFocus
Me.txtTest.Text = MinPeriod

The problem with this is it updates the txtTest control value on ALL the
records, not just the current one.   Any suggestions?
Marshall Barton - 02 Apr 2006 16:49 GMT
>I have some code written for a combo box On Change event on a form.  I would
>like to have the result of that code returned to a control on the current
[quoted text clipped - 6 lines]
>The problem with this is it updates the txtTest control value on ALL the
>records, not just the current one.

Without significantly more justification for that approach,
I have to say that you are on the wrong track.  The Change
event and Text property are only useful for analyzing the
combo box's entry before the user has completed the entry.

I suspect that you should be using the combo box's
AfterUpdate event and the Value property, no SetFocus
needed.
    Me.txtTest = MinPeriod

But, unless the txtText text box is bound to a field in the
form's record source table query, it only has one value to
display so it has to be the same for all rows.

Signature

Marsh
MVP [MS Access]

 
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.