Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box not being refreshed

Status
Not open for further replies.

dalebeitz

Programmer
Oct 3, 2001
20
0
0
US
Greetings!

I have a form based on a table (CallDetails) which includes a column called Area. This column is bound to a text box on the form for display purposes. The text box is visible but not enabled since it is not a user enterable field. The form has a combo box (CustSelect) on it that allows the user to select a customer from the Customer table. The Area field is part of the Customer table, it represents the sales area to which the customer is assigned, and is included as the third column of the combo box after the customer number and name. Column 0 of the combo box is the undisplayed customer key value. In the combo box's ON CHANGE event I set the value of the Area field to the value of the third column of the combo box, as follows:

Code:
Me.Area = Me.CustSelect.Column(3)

The correct area number is always displayed in the combo box, is always being saved correctly in the Details table's Area column, and most of the time the text box is displayed correctly. However, on occasion the Area text box on the form will be blank. Usually once it stops displaying values it will not start displaying them again until the form is closed and re-opened. There doesn't appear to be any particular set of events that causes the display error to happen. I have witnessed it first-hand when it has happen to a user, but I've been unable to recreate it in testing.

The reason I need to store the area on the details table is in case the customer changes salesmen in the future, we want to preserve the area to which he was assigned at the time the sales call occurred. The purpose for displaying the field is to let the entry person visually scan a day's worth of calls after they've finished data entry to see if a salesman is "poaching" on other salesmen's assigned customers and to follow up if this happens.

Any ideas about why this apparent display error is occuring would be greatly appreciated!

Dale Beitz
 
Instead of using the on_Change event try using the after_update event. I have seen strange things and timings occur when using the on_Change. Other than that I usally would right my code like this

Me.Area.value = Me.CustSelect.Column(3)

or

Me!Area = Me.CustSelect.Column(3)

Don't know if it is just symantics, but for me it seems to work and be easier to read.

Good Luck
ssecca

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top