home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / apps / crystal / disk18 / Xvb377._ / Xvb377. (.txt)
Visual Basic Form  |  1999-08-23  |  12KB  |  389 lines

  1. VERSION 5.00
  2. Begin VB.Form frmOrders 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Orders"
  5.    ClientHeight    =   4335
  6.    ClientLeft      =   630
  7.    ClientTop       =   1260
  8.    ClientWidth     =   6615
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4335
  13.    ScaleWidth      =   6615
  14.    ShowInTaskbar   =   0   'False
  15.    Tag             =   "Orders"
  16.    Begin VB.CommandButton cmdClose 
  17.       Cancel          =   -1  'True
  18.       Caption         =   "&Close"
  19.       Default         =   -1  'True
  20.       Height          =   300
  21.       Left            =   5520
  22.       TabIndex        =   27
  23.       Top             =   3580
  24.       Width           =   975
  25.    End
  26.    Begin VB.CommandButton cmdGrid 
  27.       Caption         =   "&Grid"
  28.       Height          =   300
  29.       Left            =   4440
  30.       TabIndex        =   26
  31.       Tag             =   "&Grid"
  32.       Top             =   3580
  33.       Width           =   975
  34.    End
  35.    Begin VB.CommandButton cmdUpdate 
  36.       Caption         =   "&Update"
  37.       Height          =   300
  38.       Left            =   3360
  39.       TabIndex        =   25
  40.       Tag             =   "&Update"
  41.       Top             =   3580
  42.       Width           =   975
  43.    End
  44.    Begin VB.CommandButton cmdRefresh 
  45.       Caption         =   "&Refresh"
  46.       Height          =   300
  47.       Left            =   2280
  48.       TabIndex        =   24
  49.       Tag             =   "&Refresh"
  50.       Top             =   3580
  51.       Width           =   975
  52.    End
  53.    Begin VB.CommandButton cmdDelete 
  54.       Caption         =   "&Delete"
  55.       Height          =   300
  56.       Left            =   1200
  57.       TabIndex        =   23
  58.       Tag             =   "&Delete"
  59.       Top             =   3580
  60.       Width           =   975
  61.    End
  62.    Begin VB.CommandButton cmdAdd 
  63.       Caption         =   "&Add"
  64.       Height          =   300
  65.       Left            =   120
  66.       TabIndex        =   22
  67.       Tag             =   "&Add"
  68.       Top             =   3580
  69.       Width           =   975
  70.    End
  71.    Begin VB.Data Data1 
  72.       Align           =   2  'Align Bottom
  73.       Connect         =   "Access"
  74.       DatabaseName    =   ""
  75.       DefaultCursorType=   0  'DefaultCursor
  76.       DefaultType     =   2  'UseODBC
  77.       Exclusive       =   0   'False
  78.       Height          =   345
  79.       Left            =   0
  80.       Options         =   0
  81.       ReadOnly        =   0   'False
  82.       RecordsetType   =   1  'Dynaset
  83.       RecordSource    =   "Orders"
  84.       Top             =   3990
  85.       Width           =   6615
  86.    End
  87.    Begin VB.CheckBox chkFields 
  88.       DataField       =   "Payment Received"
  89.       DataSource      =   "Data1"
  90.       Height          =   285
  91.       Index           =   10
  92.       Left            =   2040
  93.       TabIndex        =   21
  94.       Top             =   3240
  95.       Width           =   3375
  96.    End
  97.    Begin VB.TextBox txtFields 
  98.       DataField       =   "PO#"
  99.       DataSource      =   "Data1"
  100.       Height          =   285
  101.       Index           =   9
  102.       Left            =   2040
  103.       MaxLength       =   50
  104.       TabIndex        =   19
  105.       Top             =   2920
  106.       Width           =   3375
  107.    End
  108.    Begin VB.CheckBox chkFields 
  109.       DataField       =   "Shipped"
  110.       DataSource      =   "Data1"
  111.       Height          =   285
  112.       Index           =   8
  113.       Left            =   2040
  114.       TabIndex        =   17
  115.       Top             =   2600
  116.       Width           =   3375
  117.    End
  118.    Begin VB.TextBox txtFields 
  119.       DataField       =   "Ship Via"
  120.       DataSource      =   "Data1"
  121.       Height          =   285
  122.       Index           =   7
  123.       Left            =   2040
  124.       MaxLength       =   20
  125.       TabIndex        =   15
  126.       Top             =   2280
  127.       Width           =   3375
  128.    End
  129.    Begin VB.TextBox txtFields 
  130.       DataField       =   "Ship Date"
  131.       DataSource      =   "Data1"
  132.       Height          =   285
  133.       Index           =   6
  134.       Left            =   2040
  135.       TabIndex        =   13
  136.       Top             =   1960
  137.       Width           =   1935
  138.    End
  139.    Begin VB.TextBox txtFields 
  140.       DataField       =   "Required Date"
  141.       DataSource      =   "Data1"
  142.       Height          =   285
  143.       Index           =   5
  144.       Left            =   2040
  145.       TabIndex        =   11
  146.       Top             =   1640
  147.       Width           =   1935
  148.    End
  149.    Begin VB.TextBox txtFields 
  150.       DataField       =   "Order Date"
  151.       DataSource      =   "Data1"
  152.       Height          =   285
  153.       Index           =   4
  154.       Left            =   2040
  155.       TabIndex        =   9
  156.       Top             =   1320
  157.       Width           =   1935
  158.    End
  159.    Begin VB.TextBox txtFields 
  160.       DataField       =   "Employee ID"
  161.       DataSource      =   "Data1"
  162.       Height          =   285
  163.       Index           =   3
  164.       Left            =   2040
  165.       TabIndex        =   7
  166.       Top             =   1000
  167.       Width           =   1935
  168.    End
  169.    Begin VB.TextBox txtFields 
  170.       DataField       =   "Customer ID"
  171.       DataSource      =   "Data1"
  172.       Height          =   285
  173.       Index           =   2
  174.       Left            =   2040
  175.       TabIndex        =   5
  176.       Top             =   680
  177.       Width           =   1935
  178.    End
  179.    Begin VB.TextBox txtFields 
  180.       DataField       =   "Order Amount"
  181.       DataSource      =   "Data1"
  182.       Height          =   285
  183.       Index           =   1
  184.       Left            =   2040
  185.       TabIndex        =   3
  186.       Top             =   360
  187.       Width           =   1935
  188.    End
  189.    Begin VB.TextBox txtFields 
  190.       DataField       =   "Order ID"
  191.       DataSource      =   "Data1"
  192.       Height          =   285
  193.       Index           =   0
  194.       Left            =   2040
  195.       TabIndex        =   1
  196.       Top             =   40
  197.       Width           =   1935
  198.    End
  199.    Begin VB.Label lblLabels 
  200.       Caption         =   "Payment Received:"
  201.       Height          =   255
  202.       Index           =   10
  203.       Left            =   120
  204.       TabIndex        =   20
  205.       Tag             =   "Payment Received:"
  206.       Top             =   3260
  207.       Width           =   1815
  208.    End
  209.    Begin VB.Label lblLabels 
  210.       Caption         =   "PO#:"
  211.       Height          =   255
  212.       Index           =   9
  213.       Left            =   120
  214.       TabIndex        =   18
  215.       Tag             =   "PO#:"
  216.       Top             =   2940
  217.       Width           =   1815
  218.    End
  219.    Begin VB.Label lblLabels 
  220.       Caption         =   "Shipped:"
  221.       Height          =   255
  222.       Index           =   8
  223.       Left            =   120
  224.       TabIndex        =   16
  225.       Tag             =   "Shipped:"
  226.       Top             =   2620
  227.       Width           =   1815
  228.    End
  229.    Begin VB.Label lblLabels 
  230.       Caption         =   "Ship Via:"
  231.       Height          =   255
  232.       Index           =   7
  233.       Left            =   120
  234.       TabIndex        =   14
  235.       Tag             =   "Ship Via:"
  236.       Top             =   2300
  237.       Width           =   1815
  238.    End
  239.    Begin VB.Label lblLabels 
  240.       Caption         =   "Ship Date:"
  241.       Height          =   255
  242.       Index           =   6
  243.       Left            =   120
  244.       TabIndex        =   12
  245.       Tag             =   "Ship Date:"
  246.       Top             =   1980
  247.       Width           =   1815
  248.    End
  249.    Begin VB.Label lblLabels 
  250.       Caption         =   "Required Date:"
  251.       Height          =   255
  252.       Index           =   5
  253.       Left            =   120
  254.       TabIndex        =   10
  255.       Tag             =   "Required Date:"
  256.       Top             =   1660
  257.       Width           =   1815
  258.    End
  259.    Begin VB.Label lblLabels 
  260.       Caption         =   "Order Date:"
  261.       Height          =   255
  262.       Index           =   4
  263.       Left            =   120
  264.       TabIndex        =   8
  265.       Tag             =   "Order Date:"
  266.       Top             =   1340
  267.       Width           =   1815
  268.    End
  269.    Begin VB.Label lblLabels 
  270.       Caption         =   "Employee ID:"
  271.       Height          =   255
  272.       Index           =   3
  273.       Left            =   120
  274.       TabIndex        =   6
  275.       Tag             =   "Employee ID:"
  276.       Top             =   1020
  277.       Width           =   1815
  278.    End
  279.    Begin VB.Label lblLabels 
  280.       Caption         =   "Customer ID:"
  281.       Height          =   255
  282.       Index           =   2
  283.       Left            =   120
  284.       TabIndex        =   4
  285.       Tag             =   "Customer ID:"
  286.       Top             =   700
  287.       Width           =   1815
  288.    End
  289.    Begin VB.Label lblLabels 
  290.       Caption         =   "Order Amount:"
  291.       Height          =   255
  292.       Index           =   1
  293.       Left            =   120
  294.       TabIndex        =   2
  295.       Tag             =   "Order Amount:"
  296.       Top             =   380
  297.       Width           =   1815
  298.    End
  299.    Begin VB.Label lblLabels 
  300.       Caption         =   "Order ID:"
  301.       Height          =   255
  302.       Index           =   0
  303.       Left            =   120
  304.       TabIndex        =   0
  305.       Tag             =   "Order ID:"
  306.       Top             =   60
  307.       Width           =   1815
  308.    End
  309. Attribute VB_Name = "frmOrders"
  310. Attribute VB_GlobalNameSpace = False
  311. Attribute VB_Creatable = False
  312. Attribute VB_PredeclaredId = True
  313. Attribute VB_Exposed = False
  314. Option Explicit
  315. Private Sub cmdAdd_Click()
  316.     Data1.Recordset.AddNew
  317. End Sub
  318. Private Sub cmdClose_Click()
  319.   Me.Hide
  320. End Sub
  321. Private Sub cmdDelete_Click()
  322.     'this may produce an error if you delete the last
  323.     'record or the only record in the recordset
  324.     With Data1.Recordset
  325.         .Delete
  326.         .MoveNext
  327.         If .EOF Then .MoveLast
  328.     End With
  329. End Sub
  330. Private Sub cmdRefresh_Click()
  331.     'this is really only needed for multi user apps
  332.     Data1.Refresh
  333. End Sub
  334. Private Sub cmdUpdate_Click()
  335.     Data1.UpdateRecord
  336.     Data1.Recordset.Bookmark = Data1.Recordset.LastModified
  337. End Sub
  338. Private Sub cmdGrid_Click()
  339.     On Error GoTo cmdGrid_ClickErr
  340.     Dim f As New frmDataGrid
  341.     Set f.Data1.Recordset = Data1.Recordset
  342.     f.Caption = Me.Caption & " Grid"
  343.     f.Show
  344.     Exit Sub
  345. cmdGrid_ClickErr:
  346. End Sub
  347. Private Sub Data1_Error(DataErr As Integer, Response As Integer)
  348.     'This is where you would put error handling code
  349.     'If you want to ignore errors, comment out the next line
  350.     'If you want to trap them, add code here to handle them
  351.     MsgBox "Data error event hit err:" & Error$(DataErr)
  352.     Response = 0  'throw away the error
  353. End Sub
  354. Private Sub Data1_Reposition()
  355.     Screen.MousePointer = vbDefault
  356.     On Error Resume Next
  357.     'This will display the current record position
  358.     'for dynasets and snapshots
  359.     Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1)
  360.     'for the table object you must set the index property when
  361.     'the recordset gets created and use the following line
  362.     'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
  363. End Sub
  364. Private Sub Data1_Validate(Action As Integer, Save As Integer)
  365.     'This is where you put validation code
  366.     'This event gets called when the following actions occur
  367.     Select Case Action
  368.         Case vbDataActionMoveFirst
  369.         Case vbDataActionMovePrevious
  370.         Case vbDataActionMoveNext
  371.         Case vbDataActionMoveLast
  372.         Case vbDataActionAddNew
  373.         Case vbDataActionUpdate
  374.         Case vbDataActionDelete
  375.         Case vbDataActionFind
  376.         Case vbDataActionBookmark
  377.         Case vbDataActionClose
  378.             Screen.MousePointer = vbDefault
  379.     End Select
  380.     Screen.MousePointer = vbHourglass
  381. End Sub
  382. Private Sub Form_Load()
  383.   Center Me
  384.   Me.Data1.DatabaseName = frmMain.gsDatabase
  385. End Sub
  386. Private Sub Form_Unload(Cancel As Integer)
  387.     Screen.MousePointer = vbDefault
  388. End Sub
  389.