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.

moving between pages on tab control (new user)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
colesterg - 21 Oct 2005 22:01 GMT
Hi,
1) I would like to make a command button that allows a user to move to the
next page on a tab control.  I know this question is already answered and I
am supposed to use this code:
With Me.tabMyTabControl
       If .Value = .Pages.Count - 1 Then
           ' It's the last page, so go back to the first page.
           .Value = 0
       Else
           .Value = .Value + 1
       End If
   End With

But I am a new user and not familiar with the codes so where do I insert
this?  Do I need to make a button using the wizard and then insert this
somewhere in Microsoft's code?  

I was also wondering how to get the focus to move automatically from the last
control on one page to the first control on the next page.

2) Another problem I am having is that I want to print one page at a time,
but when I press the print record button, it prints everything out. This is
because all the tabs are on one record, but there isn't any other option in
the command buttom wizard.  Is there a way to print only one tab at a time?

Sorry this is so long.  I would be grateful for any help.
Thank you,
Nicole
Rick Brandt - 22 Oct 2005 00:04 GMT
> Hi,
> 1) I would like to make a command button that allows a user to move
[quoted text clipped - 12 lines]
> insert this?  Do I need to make a button using the wizard and then
> insert this somewhere in Microsoft's code?

Drop a button on your form with the toolbox wizard turned off, name the button
what you want, and then in the property sheet for the button go to the events
tab and find the OnClick property.  In the drop list of choices choose [Event
Procedure] and then press the build button [...] to the right.

That will take you to the VBA code window and *that* is where you code goes.

> I was also wondering how to get the focus to move automatically from
> the last control on one page to the first control on the next page.

Place a very small (but visible=true) TextBox on each page and make it last in
the TabOrder.  In its GotFocus event have code...

Me.ControlName.SetFocus

...where ControlName is the name of the desired control on the desired TabPage.

> 2) Another problem I am having is that I want to print one page at a
> time, but when I press the print record button, it prints everything
> out. This is because all the tabs are on one record, but there isn't
> any other option in the command buttom wizard.  Is there a way to
> print only one tab at a time?

Don't print forms, create a report and print that.  It is easy to open or print
a report pre-filtered to the record currently being displayed on the form by
using the WHERE argument of the OpenReport method.

DoCmd.OpenReport "ReportName",,,,"PrimaryKeyField = " & Me!PrimaryKeyField

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

steveoz@charter.net - 22 Oct 2005 22:00 GMT
> > Hi,
> > 1) I would like to make a command button that allows a user to move
[quoted text clipped - 46 lines]
> to this message.     Send instead to...
> RBrandt    at       Hunter      dot      com
 
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.