Russian version
English version
| | | | SILICON TAIGA | ISDEF | CD | | | | | | | |
 
 
 
IT-
 
 
 
RSS-

" "

osmor

, MS ACCESS.

:

  1. clsWizard :

  2. Attribute VB_Name = "clsWizard"

    Option Compare Database
    Option Explicit

    ' "" , "" MS ACCESS.
    'author: aka osmor
    'E-mail:( osmor@mail.ru e-mail -. Java-script )
    'WWW: http://www.HiProg.com
    'date: 08.11.2006

    Public m_intCurrentPage As Integer '
    Private m_strPrefSubfrm As String '
    Private m_intNumLastPage As Integer '
    Private WithEvents m_cmdPrev As CommandButton '
    Private WithEvents m_cmdNext As CommandButton '
    Private WithEvents m_cmdFinish As CommandButton '
    Private m_ctlSubfrm As SubForm '
    Private Sub Class_Initialize()
    m_intCurrentPage = 1
    m_intNumLastPage = 1
    End Sub
    Private Sub Class_Terminate()
    Set m_cmdPrev = Nothing
    Set m_cmdNext = Nothing
    Set m_cmdFinish = Nothing
    Set m_ctlSubfrm = Nothing
    End Sub
    '***********************************************************
    'comment:
    '
    '************************************************************
    Public Sub startwiz()

    On Error GoTo Err_startwiz
    ChangePage 0 '

    Exit_startwiz:
    Exit Sub
    Err_startwiz:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " startwiz "
    Resume Exit_startwiz
    End Select
    End Sub
    '***********************************************************
    'comment:
    '************************************************************
    Private Sub EnableButton()
    On Error GoTo Err_EnableButton
    Select Case m_intCurrentPage
    Case 1 '
    m_cmdNext.Enabled = True
    m_cmdNext.SetFocus
    m_cmdPrev.Enabled = False
    m_cmdFinish.Enabled = False
    Case m_intNumLastPage '
    m_cmdFinish.Enabled = True
    m_cmdPrev.Enabled = True
    m_cmdFinish.SetFocus
    m_cmdNext.Enabled = False
    Case Else '
    m_cmdPrev.Enabled = True
    m_cmdNext.Enabled = True
    m_cmdNext.SetFocus
    m_cmdFinish.Enabled = False
    End Select
    Exit_EnableButton:
    Exit Sub
    Err_EnableButton:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " EnableButton "
    Resume Exit_EnableButton
    End Select
    End Sub
    '***********************************************************
    'comment:
    '************************************************************
    Public Property Let PrefSubfrm(ByVal strPrefSubfrm As String)

    On Error GoTo Err_PrefSubfrm

    m_strPrefSubfrm = strPrefSubfrm

    Exit_PrefSubfrm:
    Exit Property
    Err_PrefSubfrm:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " PrefSubfrm "
    Resume Exit_PrefSubfrm
    End Select
    End Property
    '***********************************************************
    'comment:
    ' ""
    '************************************************************
    Public Property Get NumLastPage() As Integer

    On Error GoTo Err_NumLastPage

    NumLastPage = m_intNumLastPage

    Exit_NumLastPage:
    Exit Property
    Err_NumLastPage:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " NumLastPage "
    Resume Exit_NumLastPage
    End Select
    End Property

    Public Property Let NumLastPage(ByVal intNumLastPage As Integer)

    On Error GoTo Err_NumLastPage
    m_intNumLastPage = intNumLastPage
    Exit_NumLastPage:
    Exit Property
    Err_NumLastPage:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " NumLastPage "
    Resume Exit_NumLastPage
    End Select
    End Property
    '***********************************************************
    'comment: ""
    '************************************************************
    Public Property Set cmdPrev(ctlcmdPrev As CommandButton)

    On Error GoTo Err_cmdPrev
    Set m_cmdPrev = ctlcmdPrev
    m_cmdPrev.OnClick = "[Event Procedure]"

    Exit_cmdPrev:
    Exit Property
    Err_cmdPrev:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " cmdPrev "
    Resume Exit_cmdPrev
    End Select
    End Property
    '***********************************************************
    'comment: ""
    '************************************************************
    Public Property Set cmdNext(ctlcmdNext As CommandButton)

    On Error GoTo Err_cmdNext

    Set m_cmdNext = ctlcmdNext
    m_cmdNext.OnClick = "[Event Procedure]"

    Exit_cmdNext:
    Exit Property
    Err_cmdNext:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " cmdNext "
    Resume Exit_cmdNext
    End Select
    End Property
    '***********************************************************
    'comment:
    '************************************************************
    Public Property Set cmdFinish(ctlcmdFinish As CommandButton)

    On Error GoTo Err_cmdFinish

    Set m_cmdFinish = ctlcmdFinish
    m_cmdFinish.OnClick = "[Event Procedure]"

    Exit_cmdFinish:
    Exit Property
    Err_cmdFinish:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " cmdFinish "
    Resume Exit_cmdFinish
    End Select
    End Property
    '***********************************************************
    'comment: .
    '************************************************************
    Public Property Set Subfrm(ctlSubfrm As SubForm)

    On Error GoTo Err_Subfrm

    Set m_ctlSubfrm = ctlSubfrm

    Exit_Subfrm:
    Exit Property
    Err_Subfrm:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " Subfrm "
    Resume Exit_Subfrm
    End Select
    End Property
    '***********************************************************
    'comment: ""
    '************************************************************
    Private Sub m_cmdNext_Click()

    On Error GoTo Err_m_cmdNext_Click

    ChangePage 1 '

    Exit_m_cmdNext_Click:
    Exit Sub
    Err_m_cmdNext_Click:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " m_cmdNext_Click "
    Resume Exit_m_cmdNext_Click
    End Select
    End Sub
    '***********************************************************
    'comment: ""
    '************************************************************
    Private Sub m_cmdPrev_Click()

    On Error GoTo Err_m_cmdPrev_Click

    ChangePage -1 '

    Exit_m_cmdPrev_Click:
    Exit Sub
    Err_m_cmdPrev_Click:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " m_cmdPrev_Click "
    Resume Exit_m_cmdPrev_Click
    End Select
    End Sub
    '***********************************************************
    'comment: ""
    '************************************************************
    Private Sub m_cmdFinish_Click()

    On Error GoTo Err_m_cmdFinish_Click
    ' ""
    MsgBox " " & Chr(34) & "" & Chr(34)

    Exit_m_cmdFinish_Click:
    Exit Sub
    Err_m_cmdFinish_Click:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " m_cmdFinish_Click "
    Resume Exit_m_cmdFinish_Click
    End Select
    End Sub
    '***********************************************************
    'author: osmor
    'date: 08.11.2006
    'comment:
    '************************************************************
    Private Sub ChangePage(intI As Integer)

    On Error GoTo Err_ChangePage

    m_intCurrentPage = m_intCurrentPage + intI
    If m_intCurrentPage = 0 Then m_intCurrentPage = 1
    If m_intCurrentPage > m_intNumLastPage Then m_intCurrentPage = m_intNumLastPage
    Call EnableButton
    m_ctlSubfrm.SourceObject = m_strPrefSubfrm & CStr(m_intCurrentPage)

    Exit_ChangePage:
    Exit Sub
    Err_ChangePage:
    Select Case Err.Number
    Case Else
    MsgBox "(" & Err.Number & ") " & Err.Description & " ChangePage "
    Resume Exit_ChangePage
    End Select
    End Sub


    ( )
  1. (subform), , .
  2. , .

:
frmpage1 -
frmpage2 -
..


1 -
2 -
..

  1. "" (Load) :

Dim o_clsWizard As New clsWizard

Private Sub Form_Load()
With o_clsWizard
Set .cmdFinish = Me.cmdSave '
Set .cmdNext = Me.cmdNext '
Set .cmdPrev = Me.cmdPrev '
.NumLastPage = 4 '
.PrefSubfrm = "frmpage" '
Set .Subfrm = Me.subfPage '
.startwiz '
End With
End Sub


"" :
Private Sub Form_Unload(Cancel As Integer)
Set o_clsWizard = Nothing
End Sub

.


     
 
 
  : 27.05.2006  

| | | | SILICON TAIGA | ISDEF | CD | | | | | | | |

: Silicon Taiga    
Rambler's Top100 Rambler's Top100