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 / March 2007

Tip: Looking for answers? Try searching our database.

Problem with Change Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aviscomi - 30 Mar 2007 19:12 GMT
I have a combobox on a form (cboComp_Num) and I have the following code that
runs with the Change Event for the cbo_Comp_Num:
Me.txt_Price_Zone = Me.Comp_Num.Column(1)
Me.txt_Comp_Name = Me.Comp_Num.Column(2)
Me.txt_Comp_Add = Me.Comp_Num.Column(3)
Me.txt_Comp_City = Me.Comp_Num.Column(4)
Me.txt_Comp_St = Me.Comp_Num.Column(5)
Me.txt_Comp_Zip = Me.Comp_Num.Column(6)

The code works fine; it populates all of the above text boxes. My problem is
that the values contained within the above text boxes are carried
over/displayed when the moves onto a New Record. Once the use selects a new
Comp_Num they do change; but I prefer not to have them displayed.  Any
thoughts?

Thanks in advance!
Anthony
Jeff Boyce - 30 Mar 2007 19:51 GMT
It sounds like these text boxes are used to display values, and are not
bound (i.e., don't read/save values).  If so, you'll need to tell the form
that the values in those text boxes are null when the combo box changes (you
handle this with the Change event (I'd use the AfterUpdate, but ?!), and/or
when the record changes (e.g., a new record).

One approach might be to add code to the form's OnCurrent event that sticks
a null in each of these.

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I have a combobox on a form (cboComp_Num) and I have the following code
>that runs with the Change Event for the cbo_Comp_Num:
[quoted text clipped - 13 lines]
> Thanks in advance!
> Anthony
aviscomi - 30 Mar 2007 20:11 GMT
Thanks!
> It sounds like these text boxes are used to display values, and are not
> bound (i.e., don't read/save values).  If so, you'll need to tell the form
[quoted text clipped - 27 lines]
>> Thanks in advance!
>> Anthony
 
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.