home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch28code / frmbugs.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-02  |  33.9 KB  |  866 lines

  1. VERSION 4.00
  2. Begin VB.Form frmBugs 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "Bug Report Wizard"
  6.    ClientHeight    =   4965
  7.    ClientLeft      =   990
  8.    ClientTop       =   1575
  9.    ClientWidth     =   7755
  10.    Height          =   5370
  11.    Icon            =   "FRMBUGS.frx":0000
  12.    Left            =   930
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   4965
  15.    ScaleWidth      =   7755
  16.    Top             =   1230
  17.    Width           =   7875
  18.    Begin VB.Frame fra 
  19.       Caption         =   "Bug Details"
  20.       Height          =   4875
  21.       Index           =   2
  22.       Left            =   585
  23.       TabIndex        =   28
  24.       Tag             =   "This page contains details about the problem being reported."
  25.       Top             =   585
  26.       Visible         =   0   'False
  27.       Width           =   7665
  28.       Begin VB.TextBox txtMultiBugs 
  29.          Height          =   1185
  30.          Index           =   1
  31.          Left            =   225
  32.          MultiLine       =   -1  'True
  33.          ScrollBars      =   2  'Vertical
  34.          TabIndex        =   40
  35.          Top             =   3510
  36.          Width           =   7260
  37.       End
  38.       Begin VB.TextBox txtBugs 
  39.          Height          =   285
  40.          Index           =   1
  41.          Left            =   225
  42.          MaxLength       =   255
  43.          TabIndex        =   36
  44.          Top             =   1260
  45.          Width           =   7260
  46.       End
  47.       Begin VB.ComboBox cboBugs 
  48.          Height          =   300
  49.          Index           =   1
  50.          Left            =   4680
  51.          Sorted          =   -1  'True
  52.          Style           =   2  'Dropdown List
  53.          TabIndex        =   34
  54.          Top             =   585
  55.          Width           =   2760
  56.       End
  57.       Begin VB.ComboBox cboBugs 
  58.          Height          =   300
  59.          Index           =   0
  60.          Left            =   225
  61.          Sorted          =   -1  'True
  62.          Style           =   2  'Dropdown List
  63.          TabIndex        =   30
  64.          Top             =   585
  65.          Width           =   2760
  66.       End
  67.       Begin VB.TextBox txtMultiBugs 
  68.          Height          =   1185
  69.          Index           =   0
  70.          Left            =   225
  71.          MultiLine       =   -1  'True
  72.          ScrollBars      =   2  'Vertical
  73.          TabIndex        =   38
  74.          Top             =   1935
  75.          Width           =   7260
  76.       End
  77.       Begin VB.TextBox txtBugs 
  78.          Height          =   285
  79.          Index           =   0
  80.          Left            =   3105
  81.          MaxLength       =   255
  82.          TabIndex        =   32
  83.          Top             =   585
  84.          Width           =   1455
  85.       End
  86.       Begin VB.Label lblBugs 
  87.          BackStyle       =   0  'Transparent
  88.          Caption         =   "&Steps to Reproduce:"
  89.          Height          =   195
  90.          Index           =   5
  91.          Left            =   225
  92.          TabIndex        =   39
  93.          Top             =   3240
  94.          Width           =   2760
  95.       End
  96.       Begin VB.Label lblBugs 
  97.          BackStyle       =   0  'Transparent
  98.          Caption         =   "&Description of the Problem:"
  99.          Height          =   195
  100.          Index           =   4
  101.          Left            =   225
  102.          TabIndex        =   37
  103.          Top             =   1665
  104.          Width           =   2760
  105.       End
  106.       Begin VB.Label lblBugs 
  107.          BackStyle       =   0  'Transparent
  108.          Caption         =   "&Bug Title:"
  109.          Height          =   195
  110.          Index           =   3
  111.          Left            =   225
  112.          TabIndex        =   35
  113.          Top             =   990
  114.          Width           =   2760
  115.       End
  116.       Begin VB.Label lblBugs 
  117.          BackStyle       =   0  'Transparent
  118.          Caption         =   "&Reproducible:"
  119.          Height          =   195
  120.          Index           =   2
  121.          Left            =   4680
  122.          TabIndex        =   33
  123.          Top             =   315
  124.          Width           =   2760
  125.       End
  126.       Begin VB.Label lblBugs 
  127.          BackStyle       =   0  'Transparent
  128.          Caption         =   "&Version.Build:"
  129.          Height          =   195
  130.          Index           =   1
  131.          Left            =   3105
  132.          TabIndex        =   31
  133.          Top             =   315
  134.          Width           =   1455
  135.       End
  136.       Begin VB.Label lblBugs 
  137.          BackStyle       =   0  'Transparent
  138.          Caption         =   "&Product:"
  139.          Height          =   195
  140.          Index           =   0
  141.          Left            =   225
  142.          TabIndex        =   29
  143.          Top             =   315
  144.          Width           =   2760
  145.       End
  146.    End
  147.    Begin VB.Frame fra 
  148.       Caption         =   "Hardware Information:"
  149.       Height          =   5010
  150.       Index           =   1
  151.       Left            =   360
  152.       TabIndex        =   11
  153.       Tag             =   "This page displays information about the tester's system configuration"
  154.       Top             =   405
  155.       Visible         =   0   'False
  156.       Width           =   7530
  157.       Begin VB.TextBox txtHardware 
  158.          Height          =   285
  159.          Index           =   2
  160.          Left            =   225
  161.          MaxLength       =   255
  162.          TabIndex        =   27
  163.          Top             =   4410
  164.          Width           =   7200
  165.       End
  166.       Begin VB.TextBox txtHardware 
  167.          Height          =   285
  168.          Index           =   1
  169.          Left            =   225
  170.          MaxLength       =   255
  171.          TabIndex        =   25
  172.          Top             =   3735
  173.          Width           =   7200
  174.       End
  175.       Begin VB.ComboBox cboHardware 
  176.          Height          =   315
  177.          Index           =   4
  178.          Left            =   1665
  179.          Sorted          =   -1  'True
  180.          TabIndex        =   21
  181.          Top             =   2385
  182.          Width           =   3210
  183.       End
  184.       Begin VB.ComboBox cboHardware 
  185.          Height          =   315
  186.          Index           =   3
  187.          Left            =   1665
  188.          Sorted          =   -1  'True
  189.          TabIndex        =   19
  190.          Top             =   1890
  191.          Width           =   3210
  192.       End
  193.       Begin VB.ComboBox cboHardware 
  194.          Height          =   315
  195.          Index           =   2
  196.          Left            =   1665
  197.          Sorted          =   -1  'True
  198.          TabIndex        =   17
  199.          Top             =   1395
  200.          Width           =   3210
  201.       End
  202.       Begin VB.ComboBox cboHardware 
  203.          Height          =   315
  204.          Index           =   1
  205.          Left            =   1665
  206.          Sorted          =   -1  'True
  207.          TabIndex        =   15
  208.          Top             =   900
  209.          Width           =   3210
  210.       End
  211.       Begin VB.TextBox txtHardware 
  212.          Height          =   285
  213.          Index           =   0
  214.          Left            =   225
  215.          MaxLength       =   255
  216.          TabIndex        =   23
  217.          Top             =   3105
  218.          Width           =   7200
  219.       End
  220.       Begin VB.ComboBox cboHardware 
  221.          Height          =   315
  222.          Index           =   0
  223.          Left            =   1665
  224.          Sorted          =   -1  'True
  225.          TabIndex        =   13
  226.          Top             =   405
  227.          Width           =   3210
  228.       End
  229.       Begin VB.Label lblHardware 
  230.          BackStyle       =   0  'Transparent
  231.          Caption         =   "File S&ystems in Use:"
  232.          Height          =   195
  233.          Index           =   7
  234.          Left            =   225
  235.          TabIndex        =   26
  236.          Top             =   4140
  237.          Width           =   1410
  238.       End
  239.       Begin VB.Label lblHardware 
  240.          BackStyle       =   0  'Transparent
  241.          Caption         =   "&Floppy Drives:"
  242.          Height          =   195
  243.          Index           =   6
  244.          Left            =   225
  245.          TabIndex        =   24
  246.          Top             =   3465
  247.          Width           =   1410
  248.       End
  249.       Begin VB.Label lblHardware 
  250.          BackStyle       =   0  'Transparent
  251.          Caption         =   "&Other Adapters:"
  252.          Height          =   195
  253.          Index           =   5
  254.          Left            =   225
  255.          TabIndex        =   22
  256.          Top             =   2835
  257.          Width           =   1410
  258.       End
  259.       Begin VB.Label lblHardware 
  260.          BackStyle       =   0  'Transparent
  261.          Caption         =   "&SCSI Adapter:"
  262.          Height          =   195
  263.          Index           =   4
  264.          Left            =   225
  265.          TabIndex        =   20
  266.          Top             =   2430
  267.          Width           =   1410
  268.       End
  269.       Begin VB.Label lblHardware 
  270.          BackStyle       =   0  'Transparent
  271.          Caption         =   "&Boot Drive Type:"
  272.          Height          =   195
  273.          Index           =   3
  274.          Left            =   225
  275.          TabIndex        =   18
  276.          Top             =   1935
  277.          Width           =   1410
  278.       End
  279.       Begin VB.Label lblHardware 
  280.          BackStyle       =   0  'Transparent
  281.          Caption         =   "&Video Adapter:"
  282.          Height          =   195
  283.          Index           =   2
  284.          Left            =   225
  285.          TabIndex        =   16
  286.          Top             =   1440
  287.          Width           =   1410
  288.       End
  289.       Begin VB.Label lblHardware 
  290.          BackStyle       =   0  'Transparent
  291.          Caption         =   "&Computer Type:"
  292.          Height          =   195
  293.          Index           =   1
  294.          Left            =   225
  295.          TabIndex        =   14
  296.          Top             =   945
  297.          Width           =   1410
  298.       End
  299.       Begin VB.Label lblHardware 
  300.          BackStyle       =   0  'Transparent
  301.          Caption         =   "&Operating System:"
  302.          Height          =   195
  303.          Index           =   0
  304.          Left            =   225
  305.          TabIndex        =   12
  306.          Top             =   450
  307.          Width           =   1410
  308.       End
  309.    End
  310.    Begin VB.Frame fra 
  311.       Caption         =   "Contact Information"
  312.       Height          =   4965
  313.       Index           =   0
  314.       Left            =   90
  315.       TabIndex        =   2
  316.       Tag             =   "This page displays vital information about the tester who reported the bug."
  317.       Top             =   405
  318.       Width           =   7620
  319.       Begin VB.ComboBox cboContact 
  320.          Height          =   315
  321.          Left            =   225
  322.          Sorted          =   -1  'True
  323.          TabIndex        =   1
  324.          Top             =   765
  325.          Width           =   2625
  326.       End
  327.       Begin VB.TextBox txtContact 
  328.          Height          =   285
  329.          Index           =   2
  330.          Left            =   225
  331.          MaxLength       =   255
  332.          TabIndex        =   10
  333.          Top             =   4275
  334.          Width           =   3345
  335.       End
  336.       Begin VB.TextBox txtContact 
  337.          Height          =   285
  338.          Index           =   1
  339.          Left            =   4005
  340.          MaxLength       =   255
  341.          TabIndex        =   8
  342.          Top             =   3510
  343.          Width           =   3345
  344.       End
  345.       Begin VB.TextBox txtContact 
  346.          Height          =   285
  347.          Index           =   0
  348.          Left            =   225
  349.          MaxLength       =   255
  350.          TabIndex        =   6
  351.          Top             =   3555
  352.          Width           =   3345
  353.       End
  354.       Begin VB.TextBox txtMultiContact 
  355.          Height          =   1500
  356.          Index           =   0
  357.          Left            =   225
  358.          MultiLine       =   -1  'True
  359.          TabIndex        =   4
  360.          Top             =   1575
  361.          Width           =   7170
  362.       End
  363.       Begin VB.Label lblContact 
  364.          BackStyle       =   0  'Transparent
  365.          Caption         =   "&Beta ID:"
  366.          Height          =   195
  367.          Index           =   4
  368.          Left            =   225
  369.          TabIndex        =   0
  370.          Top             =   495
  371.          Width           =   2760
  372.       End
  373.       Begin VB.Label lblContact 
  374.          BackStyle       =   0  'Transparent
  375.          Caption         =   "&Internet Address:"
  376.          Height          =   195
  377.          Index           =   3
  378.          Left            =   225
  379.          TabIndex        =   9
  380.          Top             =   4005
  381.          Width           =   2760
  382.       End
  383.       Begin VB.Label lblContact 
  384.          BackStyle       =   0  'Transparent
  385.          Caption         =   "&Fax:"
  386.          Height          =   195
  387.          Index           =   2
  388.          Left            =   4005
  389.          TabIndex        =   7
  390.          Top             =   3240
  391.          Width           =   2760
  392.       End
  393.       Begin VB.Label lblContact 
  394.          BackStyle       =   0  'Transparent
  395.          Caption         =   "&Phone Number:"
  396.          Height          =   195
  397.          Index           =   1
  398.          Left            =   225
  399.          TabIndex        =   5
  400.          Top             =   3285
  401.          Width           =   2760
  402.       End
  403.       Begin VB.Label lblContact 
  404.          BackStyle       =   0  'Transparent
  405.          Caption         =   "&Name && Address:"
  406.          Height          =   195
  407.          Index           =   0
  408.          Left            =   225
  409.          TabIndex        =   3
  410.          Top             =   1305
  411.          Width           =   2760
  412.       End
  413.    End
  414.    Begin VB.CommandButton cmd 
  415.       BackColor       =   &H00C0C0C0&
  416.       Caption         =   "&Finish"
  417.       Enabled         =   0   'False
  418.       Height          =   375
  419.       Index           =   4
  420.       Left            =   5085
  421.       TabIndex        =   45
  422.       Top             =   2295
  423.       Width           =   1095
  424.    End
  425.    Begin VB.CommandButton cmd 
  426.       BackColor       =   &H00C0C0C0&
  427.       Caption         =   "&Next >>"
  428.       Height          =   375
  429.       Index           =   3
  430.       Left            =   3870
  431.       TabIndex        =   44
  432.       Top             =   2295
  433.       Width           =   1095
  434.    End
  435.    Begin VB.CommandButton cmd 
  436.       BackColor       =   &H00C0C0C0&
  437.       Caption         =   "<< &Previous"
  438.       Enabled         =   0   'False
  439.       Height          =   375
  440.       Index           =   2
  441.       Left            =   2700
  442.       TabIndex        =   43
  443.       Top             =   2295
  444.       Width           =   1095
  445.    End
  446.    Begin VB.CommandButton cmd 
  447.       BackColor       =   &H00C0C0C0&
  448.       Cancel          =   -1  'True
  449.       Caption         =   "&Cancel"
  450.       Height          =   375
  451.       Index           =   1
  452.       Left            =   1485
  453.       TabIndex        =   42
  454.       Top             =   2295
  455.       Width           =   1095
  456.    End
  457.    Begin VB.CommandButton cmd 
  458.       BackColor       =   &H00C0C0C0&
  459.       Caption         =   "&Hint"
  460.       Height          =   375
  461.       Index           =   0
  462.       Left            =   270
  463.       TabIndex        =   41
  464.       Top             =   2295
  465.       Width           =   1095
  466.    End
  467. Attribute VB_Name = "frmBugs"
  468. Attribute VB_Creatable = False
  469. Attribute VB_Exposed = False
  470. '*********************************************************************
  471. ' FRMBUGS.FRM - This is a bug reporting form that writes to a Access
  472. '               database via direct calls to the Jet database layer.
  473. '*********************************************************************
  474. Option Explicit
  475. Private DBase As New GenericDB
  476. Private FrameIndex%, BetaID$
  477. '*********************************************************************
  478. ' Create more descriptive names for the cmd array indicies.
  479. '*********************************************************************
  480. Private Const CMD_HINT = 0
  481. Private Const CMD_CANCEL = 1
  482. Private Const CMD_PREV = 2
  483. Private Const CMD_NEXT = 3
  484. Private Const CMD_FINISH = 4
  485. Private Const MAX_FRAMES_INDEX = 2
  486. '*********************************************************************
  487. ' Make sure a Beta ID is listed.
  488. '*********************************************************************
  489. Private Sub cboContact_LostFocus()
  490.     '*****************************************************************
  491.     ' Set the global variable.
  492.     '*****************************************************************
  493.     BetaID = Trim(cboContact)
  494.     '*****************************************************************
  495.     ' If one wasn't entered, then alert the user and halt.
  496.     '*****************************************************************
  497.     If BetaID = "" Then
  498.         PlayWaveRes "Ding"
  499.         MsgBox "This field can not be blank!", vbCritical
  500.         cboContact.SetFocus
  501.     '*****************************************************************
  502.     ' Otherwise load the other controls with the data from that id.
  503.     '*****************************************************************
  504.     Else
  505.         LoadPage
  506.     End If
  507. End Sub
  508. '*********************************************************************
  509. ' Process command button clicks.
  510. '*********************************************************************
  511. Private Sub cmd_Click(Index As Integer)
  512.     Select Case Index
  513.         '*************************************************************
  514.         ' Display a hint (from the frame's .Tag) in a message box.
  515.         '*************************************************************
  516.         Case CMD_HINT
  517.             PlayWaveRes "Chimes"
  518.             MsgBox fra(FrameIndex).Tag, vbInformation
  519.         '*************************************************************
  520.         ' Cancel is used to quit without filing a report.
  521.         '*************************************************************
  522.         Case CMD_CANCEL
  523.             If MsgBox("Are you sure you want to Quit?" _
  524.                         , vbQuestion + vbYesNo) = vbYes Then
  525.                 PlayWaveRes "Hasta"
  526.                 Unload Me
  527.             End If
  528.         '*************************************************************
  529.         ' The next two are used to navigate between frames.
  530.         '*************************************************************
  531.         Case CMD_PREV
  532.             NavigatePages False
  533.         Case CMD_NEXT
  534.             NavigatePages True
  535.         '*************************************************************
  536.         ' File the bug report.
  537.         '*************************************************************
  538.         Case CMD_FINISH
  539.             '*********************************************************
  540.             ' If UpdateData failed, then the title must have already
  541.             ' appeared in the database. Set the focus to the title
  542.             ' text box, and exit.  If the user wants to quit without
  543.             ' fixing the problem, then they'll have to use cancel.
  544.             '*********************************************************
  545.             If Not UpdateData(FrameIndex) Then
  546.                 txtBugs(1).SetFocus
  547.                 Exit Sub
  548.             End If
  549.             '*********************************************************
  550.             ' If the report was successfully filed, then ask the user
  551.             ' if they want to fine another.  If so, clear the page.
  552.             '*********************************************************
  553.             If MsgBox("Would you like to report another bug?" _
  554.                         , vbQuestion + vbYesNo) = vbYes Then
  555.                 txtBugs(1) = ""
  556.                 txtMultiBugs(0) = ""
  557.                 txtMultiBugs(1) = ""
  558.                 txtBugs(1).SetFocus
  559.             '*********************************************************
  560.             ' Otherwise tell the user goodbye, and unload.
  561.             '*********************************************************
  562.             Else
  563.                 PlayWaveRes "ItsBeen"
  564.                 MsgBox "Thank you for completing this report.", _
  565.                                                     vbInformation
  566.                 Unload Me
  567.             End If
  568.     End Select
  569. End Sub
  570. '*********************************************************************
  571. ' Position everything, open the database, load the combos, and play
  572. ' and opening tune.
  573. '*********************************************************************
  574. Private Sub Form_Load()
  575.     SetupForm
  576.     LoadFrames
  577.     '*****************************************************************
  578.     ' Open the database, and load the combos from its contents.
  579.     '*****************************************************************
  580.     DBase.OpenDB App.Path & "\bugs.mdb"
  581.     LoadCombos
  582.     '*****************************************************************
  583.     ' Play an introductory tune, and unload the splash form.
  584.     '*****************************************************************
  585.     PlayWaveRes "Game"
  586. End Sub
  587. '*********************************************************************
  588. ' Load all of the combo boxes with data from the database.
  589. '*********************************************************************
  590. Private Sub LoadCombos()
  591.     DBase.CreateRecordSet "List Defaults"
  592.     DBase.GetControlData "OS", cboHardware(0)
  593.     DBase.GetControlData "Computer", cboHardware(1)
  594.     DBase.GetControlData "Video", cboHardware(2)
  595.     DBase.GetControlData "Boot", cboHardware(3)
  596.     DBase.GetControlData "SCSI", cboHardware(4)
  597.     DBase.GetControlData "Products", cboBugs(0)
  598.     DBase.GetControlData "Repro", cboBugs(1)
  599.     DBase.Data.Close
  600.     DBase.CreateRecordSet fra(0)
  601.     DBase.GetControlData "BetaID", cboContact
  602. End Sub
  603. '*********************************************************************
  604. ' Position the buttons, form, and frames.
  605. '*********************************************************************
  606. Private Sub SetupForm()
  607. Const CMD_TOP = 5350
  608. Const CMD_WIDTH = 1095
  609. Const CMD_HEIGHT = 375
  610.     cmd(0).Move 1880, CMD_TOP, CMD_WIDTH, CMD_HEIGHT
  611.     cmd(1).Move 3095, CMD_TOP, CMD_WIDTH, CMD_HEIGHT
  612.     cmd(2).Move 4310, CMD_TOP, CMD_WIDTH, CMD_HEIGHT
  613.     cmd(3).Move 5480, CMD_TOP, CMD_WIDTH, CMD_HEIGHT
  614.     cmd(4).Move 6695, CMD_TOP, CMD_WIDTH, CMD_HEIGHT
  615.     Width = 8125
  616.     Height = 6300
  617.     Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  618.     LoadFrames
  619.     Draw3DLine
  620. End Sub
  621. '*********************************************************************
  622. ' Initializies the frames.
  623. '*********************************************************************
  624. Private Sub LoadFrames()
  625. Dim i As Integer
  626.     '*****************************************************************
  627.     ' Position the frames.
  628.     '*****************************************************************
  629.     For i = 2 To 0 Step -1
  630.         fra(i).Move 135, 135, 7665, 4875
  631.         fra(i).ZOrder
  632.     Next i
  633.     '*****************************************************************
  634.     ' Change the captions.
  635.     '*****************************************************************
  636.     fra(0) = "Contact Information"
  637.     fra(1) = "Hardware Information"
  638.     fra(2) = "Bug Details"
  639. End Sub
  640. '*********************************************************************
  641. ' Handles changing frames.
  642. '*********************************************************************
  643. Private Sub NavigatePages(ByVal bMoveNext As Boolean)
  644.     '*****************************************************************
  645.     ' If you can't update the data, then exit.
  646.     '*****************************************************************
  647.     If bMoveNext And Not UpdateData(FrameIndex) Then Exit Sub
  648.     '*****************************************************************
  649.     ' Hide the current frame, increment FrameIndex, then show the new
  650.     ' frame.
  651.     '*****************************************************************
  652.     fra(FrameIndex).Visible = False
  653.     FrameIndex = IIf(bMoveNext, FrameIndex + 1, FrameIndex - 1)
  654.     fra(FrameIndex).Visible = True
  655.     '*****************************************************************
  656.     ' Open the table for the current page, and load the data.
  657.     '*****************************************************************
  658.     DBase.Data.Close
  659.     DBase.CreateRecordSet fra(FrameIndex)
  660.     LoadPage
  661.     '*****************************************************************
  662.     ' Change the enabled status of the command buttons.
  663.     '*****************************************************************
  664.     If FrameIndex = 0 Then
  665.         cmd(CMD_PREV).Enabled = False
  666.     ElseIf FrameIndex = MAX_FRAMES_INDEX Then
  667.         cmd(CMD_NEXT).Enabled = False
  668.     Else
  669.         cmd(CMD_PREV).Enabled = True
  670.         cmd(CMD_NEXT).Enabled = True
  671.     End If
  672. End Sub
  673. '*********************************************************************
  674. ' Draw a 3D line above the command buttons.
  675. '*********************************************************************
  676. Private Sub Draw3DLine()
  677. Dim iXStart%, iXEnd%, iYStart%, iPixel%
  678.     '*****************************************************************
  679.     ' Calculate where the line should be drawn.
  680.     '*****************************************************************
  681.     iPixel = Screen.TwipsPerPixelY
  682.     iXEnd = cmd(4).Left + cmd(4).Width
  683.     iXStart = fra(0).Left + iPixel
  684.     iYStart = cmd(0).top - (iPixel * 10)
  685.     '*****************************************************************
  686.     ' Draw the grey line, then the white line underneath.
  687.     '*****************************************************************
  688.     Line (iXStart, iYStart)-(iXEnd, iYStart), vb3DShadow
  689.     iYStart = iYStart + iPixel
  690.     Line (iXStart, iYStart)-(iXEnd, iYStart), vb3DHighlight
  691. End Sub
  692. '*********************************************************************
  693. ' Write the changes or additions to the database.
  694. '*********************************************************************
  695. Private Function UpdateData(Index%, Optional AddRec) As Boolean
  696. Static Iterations As Integer
  697.     '*****************************************************************
  698.     'AddRec determines wheither to add or update a record.
  699.     '*****************************************************************
  700.     AddRec = IIf(IsMissing(AddRec), True, AddRec)
  701.     '*****************************************************************
  702.     ' Iterations is used to prevent uncontrolled recursive loops.
  703.     '*****************************************************************
  704.     Iterations = Iterations + 1
  705.     '*****************************************************************
  706.     ' Clear the error handler (for recursive calls only).
  707.     '*****************************************************************
  708.     If Iterations > 0 Then Err = 0
  709.     '*****************************************************************
  710.     ' Update the appropriate page.
  711.     '*****************************************************************
  712.     Select Case Index
  713.         '*************************************************************
  714.         ' Contact Information
  715.         '*************************************************************
  716.         Case 0
  717.             '*********************************************************
  718.             ' Verify required fields.
  719.             '*********************************************************
  720.             If Not VerifyRequiredField(txtMultiContact(0)) Then Exit Function
  721.             If Not VerifyRequiredField(txtContact(0)) Then Exit Function
  722.             DBase.AddOrEditRecord AddRec, _
  723.                 "NameAddress|" & txtMultiContact(0), _
  724.                 "Phone|" & txtContact(0), _
  725.                 "Fax|" & txtContact(1), _
  726.                 "InternetAddress|" & txtContact(2), _
  727.                 "BetaID|" & cboContact
  728.         '*************************************************************
  729.         ' Hardware Information
  730.         '*************************************************************
  731.         Case 1
  732.             If Not VerifyRequiredField(cboHardware(0)) Then Exit Function
  733.             If Not VerifyRequiredField(cboHardware(1)) Then Exit Function
  734.             If Not VerifyRequiredField(cboHardware(2)) Then Exit Function
  735.             If Not VerifyRequiredField(cboHardware(3)) Then Exit Function
  736.             DBase.AddOrEditRecord AddRec, _
  737.                 "OperatingSystem|" & cboHardware(0), _
  738.                 "ComputerType|" & cboHardware(1), _
  739.                 "VideoAdapter|" & cboHardware(2), _
  740.                 "BootDiskType|" & cboHardware(3), _
  741.                 "SCSI|" & cboHardware(4), _
  742.                 "OtherDiskTypes|" & txtHardware(0), _
  743.                 "Floppies|" & txtHardware(1), _
  744.                 "FileSystems|" & txtHardware(2), _
  745.                 "BetaID|" & BetaID
  746.         '*************************************************************
  747.         ' Bug Details
  748.         '*************************************************************
  749.         Case 2
  750.             If Not VerifyRequiredField(txtBugs(0)) Then Exit Function
  751.             If Not VerifyRequiredField(txtBugs(1)) Then Exit Function
  752.             If Not VerifyRequiredField(txtMultiBugs(0)) Then Exit Function
  753.             If Not VerifyRequiredField(txtMultiBugs(1)) Then Exit Function
  754.             DBase.AddOrEditRecord AddRec, _
  755.                 "Product|" & cboBugs(0), _
  756.                 "Build|" & txtBugs(0), _
  757.                 "Reproducible|" & cboBugs(1), _
  758.                 "Title|" & txtBugs(1), _
  759.                 "Problem|" & txtMultiBugs(0), _
  760.                 "Steps|" & txtMultiBugs(1), _
  761.                 "BetaID|" & BetaID
  762.     End Select
  763.     '*****************************************************************
  764.     ' If Index is 2 and duplicate key error, then notify the user
  765.     ' that the title is invalid.
  766.     '*****************************************************************
  767.     If Index = MAX_FRAMES_INDEX And Err = 3022 Then
  768.         PlayWaveRes "Ring"
  769.         MsgBox "A report with the same name has already been reported.", _
  770.                         vbExclamation
  771.         Iterations = 0
  772.         UpdateData = False
  773.     '*****************************************************************
  774.     ' If less than 2 iterations, then recursively call.
  775.     '*****************************************************************
  776.     ElseIf Iterations < 2 And Err Then
  777.         UpdateData = UpdateData(Index, False)
  778.         Iterations = 0
  779.     '*****************************************************************
  780.     ' Otherwise return true and reset the iterations variable.
  781.     '*****************************************************************
  782.     Else
  783.         UpdateData = True
  784.         Iterations = 0
  785.     End If
  786. End Function
  787. '*********************************************************************
  788. ' If the "Steps" text box is empty, then disable the finish button.
  789. '*********************************************************************
  790. Private Sub txtMultiBugs_Change(Index As Integer)
  791.     If Index = 1 Then
  792.         cmd(CMD_FINISH).Enabled = IIf(txtMultiBugs(1) <> "", True, False)
  793.     End If
  794. End Sub
  795. '*********************************************************************
  796. ' Loads the data from the database into the controls.
  797. '*********************************************************************
  798. Private Sub LoadPage()
  799.     '*****************************************************************
  800.     ' Find the record based on its BetaID value.
  801.     '*****************************************************************
  802.     If DBase.FindRecord("BetaID", BetaID) = "" Then
  803.         ClearAll
  804.         Exit Sub
  805.     End If
  806.     '*****************************************************************
  807.     ' Use the public FrameIndex value to determine which frame to load.
  808.     '*****************************************************************
  809.     Select Case FrameIndex
  810.         Case 0
  811.             '**********************************************************
  812.             'NOTE: & "" is appended to each line to prevent triggering
  813.             '      an error if the return value from the record is NULL.
  814.             '**********************************************************
  815.             txtMultiContact(0) = DBase.GetRecord("NameAddress") & ""
  816.             txtContact(0) = DBase.GetRecord("Phone") & ""
  817.             txtContact(1) = DBase.GetRecord("Fax") & ""
  818.             txtContact(2) = DBase.GetRecord("InternetAddress") & ""
  819.         Case 1
  820.             cboHardware(0) = DBase.GetRecord("OperatingSystem") & ""
  821.             cboHardware(1) = DBase.GetRecord("ComputerType") & ""
  822.             cboHardware(2) = DBase.GetRecord("VideoAdapter") & ""
  823.             cboHardware(3) = DBase.GetRecord("BootDiskType") & ""
  824.             cboHardware(4) = DBase.GetRecord("SCSI") & ""
  825.             txtHardware(0) = DBase.GetRecord("OtherDiskTypes") & ""
  826.             txtHardware(1) = DBase.GetRecord("Floppies") & ""
  827.             txtHardware(2) = DBase.GetRecord("FileSystems") & ""
  828.     End Select
  829. End Sub
  830. '*********************************************************************
  831. ' Clear and reset selected controls.
  832. '*********************************************************************
  833. Private Sub ClearAll()
  834.     txtMultiContact(0) = ""
  835.     txtContact(0) = ""
  836.     txtContact(1) = ""
  837.     txtContact(2) = ""
  838.     cboHardware(0).ListIndex = 0
  839.     cboHardware(1).ListIndex = 0
  840.     cboHardware(2).ListIndex = 0
  841.     cboHardware(3).ListIndex = 0
  842.     cboHardware(4).ListIndex = 0
  843.     txtHardware(0) = ""
  844.     txtHardware(1) = ""
  845.     txtHardware(2) = ""
  846. End Sub
  847. '*********************************************************************
  848. ' If the field is required, then make sure it isn't blank.
  849. '*********************************************************************
  850. Private Function VerifyRequiredField(Cntl As Control) As Boolean
  851.     If Cntl.Text = "" Then
  852.         MsgBox "This is a required field!", vbExclamation
  853.         '*************************************************************
  854.         ' Put a blank space in the control to prevent another error.
  855.         '*************************************************************
  856.         Cntl.Text = " "
  857.         Cntl.SetFocus
  858.         VerifyRequiredField = False
  859.         Exit Function
  860.     End If
  861.     '*****************************************************************
  862.     ' If its data is valid, then return True.
  863.     '*****************************************************************
  864.     VerifyRequiredField = True
  865. End Function
  866.