Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Tab confusion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jamesdeckert - 30 Aug 2005 04:10 GMT
in Access 2003 I have a customer form with one control with several tabs.
Each of the tabs shows a seperate subform of a table which has a one-to-many
relationship on the customer form.

When switching between open forms using the Window option on the menu bar,
the tab control on the customer form is often confused when I return to it.
It might be showing one subform with the wrong tab shown as active. It might
show a piece of one subform with a piece of another subform. Usually I just
select through two or three (or more) different tabs, and the problem
eventually straightens itself out with both a tab and its corresponding
subform showing.

I am assuming that this is an Access or Windows issue, but would like to
know if there is anything which I can do to minimize the risk of this
happening? It's not a big deal, but annoying.

Thanks,
James
Arvin Meyer [MVP] - 30 Aug 2005 04:57 GMT
Try adding a bit of code in the Change event of the tab control:

Me.Repaint
Signature

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

> in Access 2003 I have a customer form with one control with several tabs.
> Each of the tabs shows a seperate subform of a table which has a one-to-many
[quoted text clipped - 14 lines]
> Thanks,
> James
jamesdeckert - 02 Sep 2005 04:01 GMT
Arvin,
I am not aware of a Change event on a tab control. There is a Change event
on a field, but this isn't appropriate. The problem doesn't have to do with
data changing, but with navigating between forms and clicking the tab
controls.
I added Me.Repaint to the Activate event of the main form which triggers
when switching between open forms, but I don't know if this is the solution
or not as the problem is sporadic. There is not an Activate event for the
tabs.

thanks,
James

> Try adding a bit of code in the Change event of the tab control:
>
[quoted text clipped - 21 lines]
> > Thanks,
> > James
Arvin Meyer [MVP] - 02 Sep 2005 11:45 GMT
In Design View, select the ENTIRE tab control, not just a page. Open the
property sheet and click on the Event tab. The first event is the Change
event.

A tab control's Change event occurs when the tab pages are clicked. This is
where, you'd place code to deal with navigation between tab pages.
Signature

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

> Arvin,
> I am not aware of a Change event on a tab control. There is a Change event
[quoted text clipped - 34 lines]
> > > Thanks,
> > > James
jamesdeckert - 21 Sep 2005 23:15 GMT
Thanks Arvin,
I will try it. Since it is sporadic, I may not know for a while if it works.
I am not aware of anything "unusual" that I am doing that causes this
problem.

I am thinking that it must be caused by something that needs reformated on
the subforms. For example, maybe you can't have the subform within a certain
margin of the edge of the tab control. Right now my Left property for each of
the tab controls is .0833. This is also the Left property for the subform. I
haven't tried to add a little "border" space between the two, but may try it
if Me.repaint doesn't work.

With such little feedback on this issue, I'm thinking that it doesn't happen
to other people, and so must be something within the formating of my
tabs/subforms.

Anyway, thanks for the response

James

> In Design View, select the ENTIRE tab control, not just a page. Open the
> property sheet and click on the Event tab. The first event is the Change
[quoted text clipped - 47 lines]
> > > > Thanks,
> > > > James
jamesdeckert - 23 Sep 2005 01:55 GMT
Well I just had it happen again with me.repaint in the TabFolders_Change
event. The problem occured when I did an Alt-Tab to switch between programs,
and when I returned to Access, the tab which was active changed to the
rightmost tab with the previously active tab data shown in the tab area. So
the tab which is shown as active and the data in the tab area don't match. I
got this to repeat several times consistantly by doing the same thing.
Something causes the active tab to change.

any other Ideas?

thanks
James

> In Design View, select the ENTIRE tab control, not just a page. Open the
> property sheet and click on the Event tab. The first event is the Change
[quoted text clipped - 47 lines]
> > > > Thanks,
> > > > James
Arvin Meyer [MVP] - 25 Sep 2005 16:06 GMT
There is a margin which must be maintained between any control and the edges
of the tab control. As near as I can guess, it's very slightly under a
1/10th of an inch. Also, if your code uses SendKeys there can be very
unpredictable results when focus changes between applications. Moving
between programs using Alt+Tab would be a Windows issue.
Signature

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

> Well I just had it happen again with me.repaint in the TabFolders_Change
> event. The problem occured when I did an Alt-Tab to switch between programs,
[quoted text clipped - 60 lines]
> > > > > Thanks,
> > > > > James
jamesdeckert - 03 Oct 2005 17:50 GMT
I have added 1/10" margin and have still run into the problem. I am not using
Sendkeys (I have played with it but found it very unreliable).

I am using a routine to resize the form to the screen size from Access 2002
Desktop Developers Handbook (Litwin, Getz, Gunderloy) p. 558. The repaint
problem could be something here which has to do with not returning to the
same active tab as was active before. I could take the routine out, but
otherwise it is very nice and allows the form to resize the controls to fit
the current screen size without designing multiple forms. The routine is
fairly involved and haven't taken the time to try debugging.

thanks for all the help,
James

> There is a margin which must be maintained between any control and the edges
> of the tab control. As near as I can guess, it's very slightly under a
[quoted text clipped - 82 lines]
> > > > > > Thanks,
> > > > > > James
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.