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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LostFocus in subform not firing

Status
Not open for further replies.

AngelB

Programmer
Feb 9, 2004
1,477
GB
Hi All,
I have a subform containing a product and a
'number-of-sales' field. On the main form the user enters a financial period and a market area, then all products relevant to that data are displayed in the subform. I have put some code in the lostfocus event of the product code textbox on the subform, but when I tab out of this box nothing happens. If I click back into it then out again, the code fires.

Does anyone know why this is happening and how I can make the code execute on the first tab-out?

Thanks

Geraint
 
Hi Geraint,
If you are leaving the subform when you tab out of the control the lostfocus event does not occur, try moving the code to the exit event and see if this works.

I've had trouble with subforms in the past and it's usually easier to find a work around than dig out an explanation of why things are happening.

Hope this helps,
Philh123
 
Thanks Phil, I wasn't leaving the subform when tabbing out of the control but the exit event works every time.

Thanks

Geraint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top