text boxes behaving badly!


Posted by james on January 08, 2002 9:11 PM

I have just created a userform with numerous textboxes for a user to enter in an items quantity. Each text box is linked to a spereadsheet through the control source property.

The user then clicks a command button to print a report based on the users data entry. For example 7 x widgets, 3x apples, 5 x oranges.

My difficulty is getting the system to recognise the last user entry. If the user types 5 in the oranges text box as their last entry before clicking the command button, the system doesn't recognise this and just prints the first 2 entry's.

The report works fine if after typing in the last piece of data the user then clicks on another textbox (this has the effect of updating the control source cell reference).

I think this problem can be resolved by updating the control source field before executing the marco behind the print button. Does anybody know how to do this, without first clicking on another textbox. Thanks for all your help

James



Posted by Jacob on January 08, 2002 10:09 PM

Hi

Depending on what you are trying to do this might help. At the begging of the code put userform1.textbox1.setfocus this will select the first textbox and should update the fields.

HTH

Jacob