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 Programming / June 2007

Tip: Looking for answers? Try searching our database.

Creating A Wizard Type Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dan.cawthorne@gmail.com - 20 Jun 2007 11:23 GMT
Hello,

How Does One Create Like a User Wizard for inputting data into a table
which holds about 30 fields

The Aim Its to have the Wizard fill in the Projects Table in like 3
seperate Windows

Which i would assume id have to create 3 seperate Forms With The
Required Fields on Each Form with a Next Buttom Command which would
open the Next Form in The Wizard.

But it Carry's on Imputting the data in the same record? how do i do
this?

Regards

Dan
Scott McDaniel - 20 Jun 2007 11:40 GMT
>Hello,
>
>How Does One Create Like a User Wizard for inputting data into a table
>which holds about 30 fields

Wizards are often done with Tab controls, with the Tab Style set to None ... you then use syntax like this to move back
and forth to the tabs:

Me.YourTabControl.Pages(2).SetFocus

I normally use a Select Case structure to handle the various items; it can get pretty complex, but with only 3 tabs it
should be pretty simple. In the example below, my tab control is named tabReportWizard,

Select Case Me.tabReportWizard
     Case Me.tabReportWizard.Pages("pgeMain").PageIndex
        Me.tabReportWizard.Pages("pgeReportType").SetFocus
    Case Me.tabReportWizard.Pages("pgeReportType").PageIndex
        Me.tabReportWizard.Pages("pgeSelectFields").SetFocus
    Case Me.tabReportWizard.Pages("pgeSelectFields").PageIndex
             Me.tabReportWizard.Pages("pgeFinish").SetFocus
     Case Else
End Select

Of course you must also handle when the user wishes to progress backwards in the wizard (if you support that); in that
case, the Select Case is pretty much the reverse of what's above:

Select Case Me.tabReportWizard
     Case Me.tabReportWizard.Pages("pgeMain").PageIndex
        '/do nothing - this is the first page
    Case Me.tabReportWizard.Pages("pgeReportType").PageIndex
        Me.tabReportWizard.Pages("pgeMain").SetFocus
    Case Me.tabReportWizard.Pages("pgeSelectFields").PageIndex
             Me.tabReportWizard.Pages("pgeReportType").SetFocus
    Case Me.tabReportWizard.Pages("pgeFinish").PageIndex
        Me.tabReportWizard.Pages("pgeReportType").SetFocus
     Case Else
End Select

As the user progresses along the wizard, you'd collect the data and ONLY when they click the Finish button would you
then input the data ... you can do so with SQL:

Sub btnFinish_Click()
    Currentdb.Execute "INSERT INTO SomeTable(Col1, Col2, Col3) VALUES(Val1, Val2, Val3)"
End Sub

Val1, Val2, and Val3 would be information inputted by the user ... how you store that is up to you, but you can use
form-level variables, User Defined Types, class modules, etc. UDTs are especially useful for this.

>The Aim Its to have the Wizard fill in the Projects Table in like 3
>seperate Windows
>
>Which i would assume id have to create 3 seperate Forms With The
>Required Fields on Each Form with a Next Buttom Command which would
>open the Next Form in The Wizard.

If you do it this way, you'll end up with incomplete records, since Form1 would input a record, then Form2 would input a
different record, etc etc ... you could do it like this, wiht your First form entering the new record, then the
subsequent forms simply Updating that record ... could be tricky, and data integrity would depend on timing as much as
anything (and that's never good).

>But it Carry's on Imputting the data in the same record? how do i do
>this?
>
>Regards
>
>Dan

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
dan.cawthorne@gmail.com - 20 Jun 2007 12:47 GMT
> >Hello,
>
[quoted text clipped - 65 lines]
> Scott McDaniel
> scott@takemeout_infotrakker.comwww.infotrakker.com

Thank You Very Much Scott, I Will Have A Play With That Some Time
Tonight!!
dan.cawthorne@gmail.com - 20 Jun 2007 14:02 GMT
On Jun 20, 12:47 pm, "dan.cawtho...@gmail.com"
<dan.cawtho...@gmail.com> wrote:

> > >Hello,
>
[quoted text clipped - 70 lines]
>
> - Show quoted text -

Not Having Much Luck Mate,

I Have Created The Form, and I Have The Required Fields Split of Over
The 3 Tabs,

The Form is Called "Projects_Input"
And The Tab is Called "ProjectInputtab"

How am I Creating in the Button? Button is Command4

I Persume Im going into the code builder
 
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.