Tab page Lost Focus Event

AndreT

Registered User.
Local time
Today, 09:32
Joined
Mar 16, 2011
Messages
26
Created a tab page to update a table record. For each field's afterupdate event, an update query is executed to update the record. I assume this causes network traffic. (I like DIY, not crazy about split form)

To reduce network traffic, I added an invisible count control, instead of executing update query, I increased the count by 1, then when the tab lose focus, I can execute the update query. Maybe add a timer to update the query every 5 or 10 min.

Great idea, eh? Except there is no "on lost focus" event for a tab page. Why, why, why:confused:

Any alternative is welcomed.
 
Why not just use a bound form? But anyway, when using a tab control you use the On Change event of the main tab control (the control on the form which has the different tab pages). The others are essentially useless. So you can set a variable and then in the On Change event of the tab control you can check to see if the value of the main tab control has changed (which would indicate that it is now on a different tab page) and, if so, run your query.
 
Re: Tab page Lost Focus Event - Thanks

Hi, Bob -

Thanks for the advice. Tried it and works just like you said. Except I realized it doesn't work with my philosophy of refreshing other displays real time. Had to send through network to refresh them.

Never thought it is controlled somewhere else. Learned something new. Thanks.

BTW, you got quite a resume on the internet ;)

Andre
 
Hi All,
Hope you don't mind me continuing on this thread.
I have the same problem - I'm using the Change event for the tab control to put up a msgbox to ask if they want to save changes - This works, but by the time the msgbox has popped up, the tab has already changed and it just doesn't look right having a message box pop up asking about a tab which you can no longer see.
The reason I'm saving pages by each tab is that the database is running across a really slow WAN (as it happens I load each page only if it is clicked on to save a bit more bandwidth aswell).
So I'm guess I'm looking for any event I can use to catch a page change on a tab control BEFORE the page has actually changed.
This is on Access 2003 on XP.

Thanks for any help

Kristian
 

Users who are viewing this thread

Back
Top Bottom