home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Special / chip-cd_2001_spec_05.zip / spec_05 / apps / crystal / disk18 / Xvb377._ / Xvb377.
Text File  |  1999-08-23  |  12KB  |  415 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. End
  310. Attribute VB_Name = "frmOrders"
  311. Attribute VB_GlobalNameSpace = False
  312. Attribute VB_Creatable = False
  313. Attribute VB_PredeclaredId = True
  314. Attribute VB_Exposed = False
  315. Option Explicit
  316.  
  317. Private Sub cmdAdd_Click()
  318.     Data1.Recordset.AddNew
  319. End Sub
  320.  
  321.  
  322. Private Sub cmdClose_Click()
  323.   Me.Hide
  324. End Sub
  325.  
  326. Private Sub cmdDelete_Click()
  327.     'this may produce an error if you delete the last
  328.     'record or the only record in the recordset
  329.     With Data1.Recordset
  330.         .Delete
  331.         .MoveNext
  332.         If .EOF Then .MoveLast
  333.     End With
  334. End Sub
  335.  
  336.  
  337. Private Sub cmdRefresh_Click()
  338.     'this is really only needed for multi user apps
  339.     Data1.Refresh
  340. End Sub
  341.  
  342.  
  343. Private Sub cmdUpdate_Click()
  344.     Data1.UpdateRecord
  345.     Data1.Recordset.Bookmark = Data1.Recordset.LastModified
  346. End Sub
  347.  
  348.  
  349. Private Sub cmdGrid_Click()
  350.     On Error GoTo cmdGrid_ClickErr
  351.  
  352.  
  353.     Dim f As New frmDataGrid
  354.     Set f.Data1.Recordset = Data1.Recordset
  355.     f.Caption = Me.Caption & " Grid"
  356.     f.Show
  357.  
  358.  
  359.     Exit Sub
  360. cmdGrid_ClickErr:
  361. End Sub
  362.  
  363.  
  364. Private Sub Data1_Error(DataErr As Integer, Response As Integer)
  365.     'This is where you would put error handling code
  366.     'If you want to ignore errors, comment out the next line
  367.     'If you want to trap them, add code here to handle them
  368.     MsgBox "Data error event hit err:" & Error$(DataErr)
  369.     Response = 0  'throw away the error
  370. End Sub
  371.  
  372.  
  373. Private Sub Data1_Reposition()
  374.     Screen.MousePointer = vbDefault
  375.     On Error Resume Next
  376.     'This will display the current record position
  377.     'for dynasets and snapshots
  378.     Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1)
  379.     'for the table object you must set the index property when
  380.     'the recordset gets created and use the following line
  381.     'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
  382. End Sub
  383.  
  384.  
  385. Private Sub Data1_Validate(Action As Integer, Save As Integer)
  386.     'This is where you put validation code
  387.     'This event gets called when the following actions occur
  388.     Select Case Action
  389.         Case vbDataActionMoveFirst
  390.         Case vbDataActionMovePrevious
  391.         Case vbDataActionMoveNext
  392.         Case vbDataActionMoveLast
  393.         Case vbDataActionAddNew
  394.         Case vbDataActionUpdate
  395.         Case vbDataActionDelete
  396.         Case vbDataActionFind
  397.         Case vbDataActionBookmark
  398.         Case vbDataActionClose
  399.             Screen.MousePointer = vbDefault
  400.     End Select
  401.     Screen.MousePointer = vbHourglass
  402. End Sub
  403.  
  404. Private Sub Form_Load()
  405.   Center Me
  406.   Me.Data1.DatabaseName = frmMain.gsDatabase
  407. End Sub
  408.  
  409. Private Sub Form_Unload(Cancel As Integer)
  410.     Screen.MousePointer = vbDefault
  411. End Sub
  412.  
  413.  
  414.  
  415.