home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / crwdemo / groupcon.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  8.7 KB  |  271 lines

  1. VERSION 2.00
  2. Begin Form Groupcond 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Group Condition"
  5.    ClientHeight    =   7125
  6.    ClientLeft      =   1890
  7.    ClientTop       =   1440
  8.    ClientWidth     =   3420
  9.    Height          =   7530
  10.    Left            =   1830
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   7125
  13.    ScaleWidth      =   3420
  14.    Top             =   1095
  15.    Width           =   3540
  16.    Begin SSPanel Statusbar 
  17.       Alignment       =   1  'Left Justify - MIDDLE
  18.       BevelWidth      =   2
  19.       BorderWidth     =   1
  20.       Height          =   465
  21.       Left            =   0
  22.       TabIndex        =   19
  23.       Top             =   6660
  24.       Width           =   3435
  25.    End
  26.    Begin CommandButton Command3 
  27.       Caption         =   "Reset"
  28.       Height          =   420
  29.       Left            =   1800
  30.       TabIndex        =   18
  31.       Top             =   6120
  32.       Width           =   1275
  33.    End
  34.    Begin CommandButton Command2 
  35.       Caption         =   "Done"
  36.       Height          =   420
  37.       Left            =   360
  38.       TabIndex        =   17
  39.       Top             =   6120
  40.       Width           =   1275
  41.    End
  42.    Begin SSPanel Panel3D3 
  43.       Alignment       =   1  'Left Justify - MIDDLE
  44.       BevelInner      =   1  'Inset
  45.       BorderWidth     =   1
  46.       Height          =   1860
  47.       Left            =   360
  48.       TabIndex        =   8
  49.       Top             =   3645
  50.       Width           =   2715
  51.       Begin SSFrame Frame3D2 
  52.          ForeColor       =   &H00000000&
  53.          Height          =   1005
  54.          Left            =   180
  55.          TabIndex        =   10
  56.          Top             =   630
  57.          Width           =   2355
  58.          Begin SSOption Option3D4 
  59.             Caption         =   "Descending"
  60.             Height          =   285
  61.             Index           =   1
  62.             Left            =   180
  63.             TabIndex        =   3
  64.             TabStop         =   0   'False
  65.             Top             =   585
  66.             Width           =   1365
  67.          End
  68.          Begin SSOption Option3D4 
  69.             Caption         =   "Ascending"
  70.             Height          =   240
  71.             Index           =   0
  72.             Left            =   180
  73.             TabIndex        =   5
  74.             Top             =   225
  75.             Value           =   -1  'True
  76.             Width           =   1365
  77.          End
  78.       End
  79.       Begin SSFrame Frame3D1 
  80.          ForeColor       =   &H00000000&
  81.          Height          =   465
  82.          Left            =   180
  83.          TabIndex        =   9
  84.          Top             =   90
  85.          Width           =   2355
  86.          Begin Label Label3 
  87.             BackColor       =   &H00C0C0C0&
  88.             Caption         =   "Sort Direction of Group"
  89.             Height          =   240
  90.             Left            =   180
  91.             TabIndex        =   6
  92.             Top             =   180
  93.             Width           =   2085
  94.          End
  95.       End
  96.    End
  97.    Begin SSPanel Panel3D2 
  98.       Alignment       =   1  'Left Justify - MIDDLE
  99.       BevelInner      =   1  'Inset
  100.       BorderWidth     =   1
  101.       Height          =   510
  102.       Left            =   360
  103.       TabIndex        =   2
  104.       Top             =   900
  105.       Width           =   2715
  106.       Begin TextBox Text1 
  107.          FontBold        =   -1  'True
  108.          FontItalic      =   0   'False
  109.          FontName        =   "MS Sans Serif"
  110.          FontSize        =   9.75
  111.          FontStrikethru  =   0   'False
  112.          FontUnderline   =   0   'False
  113.          Height          =   420
  114.          Left            =   90
  115.          TabIndex        =   7
  116.          Top             =   45
  117.          Width           =   2535
  118.       End
  119.    End
  120.    Begin SSPanel Panel3D1 
  121.       Alignment       =   1  'Left Justify - MIDDLE
  122.       BevelInner      =   1  'Inset
  123.       BorderWidth     =   1
  124.       Height          =   2085
  125.       Left            =   360
  126.       TabIndex        =   1
  127.       Top             =   1485
  128.       Width           =   2715
  129.       Begin SSFrame Frame3D4 
  130.          ForeColor       =   &H00000000&
  131.          Height          =   1320
  132.          Left            =   180
  133.          TabIndex        =   12
  134.          Top             =   585
  135.          Width           =   2355
  136.          Begin SSOption Option3D1 
  137.             Caption         =   "Other"
  138.             Height          =   240
  139.             Index           =   2
  140.             Left            =   180
  141.             TabIndex        =   16
  142.             TabStop         =   0   'False
  143.             Top             =   900
  144.             Width           =   1185
  145.          End
  146.          Begin SSOption Option3D1 
  147.             Caption         =   "Boolean"
  148.             Height          =   240
  149.             Index           =   1
  150.             Left            =   180
  151.             TabIndex        =   15
  152.             TabStop         =   0   'False
  153.             Top             =   585
  154.             Width           =   1095
  155.          End
  156.          Begin SSOption Option3D1 
  157.             Caption         =   "Date"
  158.             Height          =   195
  159.             Index           =   0
  160.             Left            =   180
  161.             TabIndex        =   14
  162.             Top             =   225
  163.             Value           =   -1  'True
  164.             Width           =   1545
  165.          End
  166.       End
  167.       Begin SSFrame Frame3D3 
  168.          ForeColor       =   &H00000000&
  169.          Height          =   420
  170.          Left            =   180
  171.          TabIndex        =   11
  172.          Top             =   90
  173.          Width           =   2355
  174.          Begin Label Label2 
  175.             BackColor       =   &H00C0C0C0&
  176.             Caption         =   "Field Type:"
  177.             Height          =   195
  178.             Left            =   180
  179.             TabIndex        =   13
  180.             Top             =   135
  181.             Width           =   1365
  182.          End
  183.       End
  184.    End
  185.    Begin CommandButton Command1 
  186.       Caption         =   "More  >>>>"
  187.       Height          =   420
  188.       Left            =   360
  189.       TabIndex        =   0
  190.       Top             =   5580
  191.       Width           =   2715
  192.    End
  193.    Begin Label Label1 
  194.       BackColor       =   &H00C0C0C0&
  195.       Caption         =   "Please enter the name of the field you would like to group on:"
  196.       Height          =   420
  197.       Left            =   90
  198.       TabIndex        =   4
  199.       Top             =   315
  200.       Width           =   3435
  201.    End
  202. Sub Command1_Click ()
  203.  'Test to see if the user inputted a field name to group on
  204.  If Text1.Text = "" Then
  205.    MsgBox "Please Enter a field name to group on!"
  206.    Exit Sub
  207.  End If
  208.  If Option3D1(0) = True Then
  209.    Datecond.Show 1     'Show form to make date group conditions
  210.  End If
  211.  If Option3D1(1) = True Then
  212.    BoolCond.Show 1     'Show form to make boolean group conditions
  213.  End If
  214.  If Option3D1(2) = True Then
  215.      'If the field type is an other then the group should act on any change
  216.      'Set the group condition
  217.      'the 3000 pertains to the section code. For 1 group in the report the only section code
  218.      'would be 3000. If there were more than one group then each subsequent group section would
  219.      'have a section code of 3001, 3002.....etc. See doc for more information.
  220.      If PESetGroupCondition(JobNum, 3000, gRoupcond.Text1.Text, PE_GC_ANYCHANGE, Sortdir) = False Then
  221.       RCode = GetErrorString(JobNum)
  222.       MsgBox "PESetGroupCondition Error #: " + Str(ErrorCode) + " - " + RCode
  223.      Else
  224.        gRoupcond!Statusbar.Caption = "Group Condition has been set."
  225.      End If
  226.  End If
  227. End Sub
  228. Sub Command2_Click ()
  229.  'Unloads form
  230.  Unload Me
  231. End Sub
  232. Sub Command3_Click ()
  233.  'Resets all field name, field type and sort direction settings
  234.  Text1.Text = ""
  235.  Command1.Visible = True
  236.  Option3D1(0).Value = True
  237.  Option3d4(0).Value = True
  238. End Sub
  239. Sub Form_Load ()
  240.  Sortdir = 1
  241. End Sub
  242. Sub Option3D1_Click (Index As Integer, Value As Integer)
  243.    'Set the Fieldtype(i.e. Date, boolean or other)
  244.    Select Case Index
  245.     Case 0:
  246.       FieldType = 1
  247.     Case 1:
  248.       FieldType = 2
  249.     Case 2:
  250.       FieldType = 3
  251.       Command1.Visible = True
  252.    End Select
  253.    'The command button will actually function differently depending on the
  254.    'conditions specified above. Therefore, the caption will change.
  255.    If Option3D1(2) = True Then
  256.      Command1.Caption = "Set Group Condition"
  257.    Else
  258.      Command1.Caption = "More >>>"
  259.    End If
  260. End Sub
  261. Sub Option3D4_Click (Index As Integer, Value As Integer)
  262.    Command1.Visible = True
  263.    'Specify Sortdirection of group section
  264.    Select Case Index
  265.     Case 0:
  266.       Sortdir = 1
  267.     Case 1:
  268.        Sortdir = 0
  269.    End Select
  270. End Sub
  271.