home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Special / chip-cd_2001_spec_05.zip / spec_05 / apps / crystal / disk18 / Xvb382._ / Xvb382.
Text File  |  1999-08-23  |  11KB  |  370 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. End
  268. Attribute VB_Name = "frmPurchases"
  269. Attribute VB_GlobalNameSpace = False
  270. Attribute VB_Creatable = False
  271. Attribute VB_PredeclaredId = True
  272. Attribute VB_Exposed = False
  273. Option Explicit
  274.  
  275. Private Sub cmdAdd_Click()
  276.     Data1.Recordset.AddNew
  277. End Sub
  278.  
  279.  
  280. Private Sub cmdClose_Click()
  281.   Me.Hide
  282. End Sub
  283.  
  284. Private Sub cmdDelete_Click()
  285.     'this may produce an error if you delete the last
  286.     'record or the only record in the recordset
  287.     With Data1.Recordset
  288.         .Delete
  289.         .MoveNext
  290.         If .EOF Then .MoveLast
  291.     End With
  292. End Sub
  293.  
  294.  
  295. Private Sub cmdRefresh_Click()
  296.     'this is really only needed for multi user apps
  297.     Data1.Refresh
  298. End Sub
  299.  
  300.  
  301. Private Sub cmdUpdate_Click()
  302.     Data1.UpdateRecord
  303.     Data1.Recordset.Bookmark = Data1.Recordset.LastModified
  304. End Sub
  305.  
  306.  
  307. Private Sub cmdGrid_Click()
  308.     On Error GoTo cmdGrid_ClickErr
  309.  
  310.  
  311.     Dim f As New frmDataGrid
  312.     Set f.Data1.Recordset = Data1.Recordset
  313.     f.Caption = Me.Caption & " Grid"
  314.     f.Show
  315.  
  316.  
  317.     Exit Sub
  318. cmdGrid_ClickErr:
  319. End Sub
  320.  
  321.  
  322. Private Sub Data1_Error(DataErr As Integer, Response As Integer)
  323.     'This is where you would put error handling code
  324.     'If you want to ignore errors, comment out the next line
  325.     'If you want to trap them, add code here to handle them
  326.     MsgBox "Data error event hit err:" & Error$(DataErr)
  327.     Response = 0  'throw away the error
  328. End Sub
  329.  
  330.  
  331. Private Sub Data1_Reposition()
  332.     Screen.MousePointer = vbDefault
  333.     On Error Resume Next
  334.     'This will display the current record position
  335.     'for dynasets and snapshots
  336.     Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1)
  337.     'for the table object you must set the index property when
  338.     'the recordset gets created and use the following line
  339.     'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
  340. End Sub
  341.  
  342.  
  343. Private Sub Data1_Validate(Action As Integer, Save As Integer)
  344.     'This is where you put validation code
  345.     'This event gets called when the following actions occur
  346.     Select Case Action
  347.         Case vbDataActionMoveFirst
  348.         Case vbDataActionMovePrevious
  349.         Case vbDataActionMoveNext
  350.         Case vbDataActionMoveLast
  351.         Case vbDataActionAddNew
  352.         Case vbDataActionUpdate
  353.         Case vbDataActionDelete
  354.         Case vbDataActionFind
  355.         Case vbDataActionBookmark
  356.         Case vbDataActionClose
  357.             Screen.MousePointer = vbDefault
  358.     End Select
  359.     Screen.MousePointer = vbHourglass
  360. End Sub
  361.  
  362. Private Sub Form_Load()
  363.   Center Me
  364.   Me.Data1.DatabaseName = frmMain.gsDatabase
  365. End Sub
  366.  
  367. Private Sub Form_Unload(Cancel As Integer)
  368.     Screen.MousePointer = vbDefault
  369. End Sub
  370.