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!

Using Setfoucs method is cancelling BeforeUpdate event

Status
Not open for further replies.

JoeHank

Programmer
Feb 13, 2003
7
0
0
US
Hi,

I'm trying to capture the Old Value and Current Values of all the controls on a form in the form's BeforeUpdate event. I created a function that iterates thru the controls on the form and returns the values I need, the problem is that I need the text <a href=" of a combo box on the form so I setfocus to the control if it is a combo box. If the combo box has the focus before the function runs everything is fine. Else when the function returns the combo box control has the focus and the BeforeUpdate event has now been canceled. Is there anyway to prevent this from happening.
 
JoeHank,

Coule of things here. First, you don't need to set the focus to the combo box to read from it. The only time you do is if you try to read from combo0.text. If it doesn't have the focus you can get data by simply reading from combo0.value or Me.combo0.

Good luck,
ttba
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top