home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Special / chip-cd_2001_spec_05.zip / spec_05 / apps / crystal / disk18 / Xvb380._ / Xvb380.
Text File  |  1999-08-23  |  11KB  |  375 lines

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