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

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