home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch05code / chapter5.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-15  |  11.6 KB  |  372 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Retail Items Data Entry"
  4.    ClientHeight    =   5745
  5.    ClientLeft      =   825
  6.    ClientTop       =   1185
  7.    ClientWidth     =   8385
  8.    Height          =   6210
  9.    Left            =   735
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5745
  12.    ScaleWidth      =   8385
  13.    Top             =   810
  14.    Width           =   8565
  15.    Begin VB.Data Supplier 
  16.       Caption         =   "Suppliers"
  17.       Connect         =   "Access"
  18.       DatabaseName    =   "TRITON2.MDB"
  19.       Exclusive       =   0   'False
  20.       Height          =   270
  21.       Left            =   2880
  22.       Options         =   0
  23.       ReadOnly        =   0   'False
  24.       RecordsetType   =   1  'Dynaset
  25.       RecordSource    =   "Suppliers"
  26.       Top             =   5400
  27.       Visible         =   0   'False
  28.       Width           =   3015
  29.    End
  30.    Begin VB.CommandButton Command5 
  31.       Caption         =   "Show in Price Order"
  32.       Height          =   375
  33.       Left            =   240
  34.       TabIndex        =   21
  35.       Top             =   5160
  36.       Width           =   2295
  37.    End
  38.    Begin VB.CommandButton Command4 
  39.       Caption         =   "Browse Mode"
  40.       Height          =   375
  41.       Left            =   6240
  42.       TabIndex        =   19
  43.       Top             =   5160
  44.       Width           =   1935
  45.    End
  46.    Begin VB.PictureBox Picture1 
  47.       Height          =   4935
  48.       Left            =   0
  49.       ScaleHeight     =   4905
  50.       ScaleWidth      =   8385
  51.       TabIndex        =   0
  52.       Top             =   0
  53.       Width           =   8415
  54.       Begin VB.ComboBox Combo1 
  55.          DataField       =   "Product Category"
  56.          DataSource      =   "Items"
  57.          Height          =   300
  58.          Left            =   1560
  59.          TabIndex        =   24
  60.          Text            =   "Combo1"
  61.          Top             =   960
  62.          Width           =   1935
  63.       End
  64.       Begin VB.CommandButton Command6 
  65.          Caption         =   "Find Item Code"
  66.          Height          =   375
  67.          Left            =   5280
  68.          TabIndex        =   22
  69.          Top             =   4080
  70.          Width           =   1815
  71.       End
  72.       Begin VB.PictureBox Picture2 
  73.          DataField       =   "Photo"
  74.          DataSource      =   "Items"
  75.          Height          =   1815
  76.          Left            =   1320
  77.          ScaleHeight     =   1785
  78.          ScaleWidth      =   2145
  79.          TabIndex        =   20
  80.          Top             =   2880
  81.          Width           =   2175
  82.       End
  83.       Begin VB.CommandButton Command3 
  84.          Caption         =   "Add Photo"
  85.          Height          =   375
  86.          Left            =   120
  87.          TabIndex        =   18
  88.          Top             =   3240
  89.          Width           =   975
  90.       End
  91.       Begin VB.CommandButton Command2 
  92.          Caption         =   "Delete Current Record"
  93.          Height          =   375
  94.          Left            =   5280
  95.          TabIndex        =   17
  96.          Top             =   3480
  97.          Width           =   1815
  98.       End
  99.       Begin VB.TextBox Text6 
  100.          DataField       =   "OnHand"
  101.          DataSource      =   "Items"
  102.          Height          =   285
  103.          Left            =   5760
  104.          TabIndex        =   16
  105.          Text            =   "Text6"
  106.          Top             =   2160
  107.          Width           =   855
  108.       End
  109.       Begin VB.TextBox Text5 
  110.          DataField       =   "Min Quantity"
  111.          DataSource      =   "Items"
  112.          Height          =   285
  113.          Left            =   2880
  114.          TabIndex        =   15
  115.          Text            =   "Text5"
  116.          Top             =   2160
  117.          Width           =   975
  118.       End
  119.       Begin VB.TextBox Text4 
  120.          DataField       =   "Retail"
  121.          DataSource      =   "Items"
  122.          Height          =   285
  123.          Left            =   4440
  124.          TabIndex        =   14
  125.          Text            =   "Text4"
  126.          Top             =   1560
  127.          Width           =   855
  128.       End
  129.       Begin VB.TextBox Text3 
  130.          DataField       =   "Wholesale"
  131.          DataSource      =   "Items"
  132.          Height          =   285
  133.          Left            =   1560
  134.          TabIndex        =   13
  135.          Text            =   "Text3"
  136.          Top             =   1560
  137.          Width           =   975
  138.       End
  139.       Begin VB.TextBox Text2 
  140.          DataField       =   "Item Description"
  141.          DataSource      =   "Items"
  142.          Height          =   285
  143.          Left            =   3840
  144.          TabIndex        =   12
  145.          Text            =   "Text2"
  146.          Top             =   360
  147.          Width           =   4215
  148.       End
  149.       Begin VB.TextBox Text1 
  150.          DataField       =   "Item Code"
  151.          DataSource      =   "Items"
  152.          Height          =   285
  153.          Left            =   1080
  154.          TabIndex        =   11
  155.          Text            =   "Text1"
  156.          Top             =   360
  157.          Width           =   1095
  158.       End
  159.       Begin VB.CommandButton Command1 
  160.          Caption         =   "Add New Record"
  161.          Height          =   375
  162.          Left            =   5280
  163.          TabIndex        =   10
  164.          Top             =   2880
  165.          Width           =   1815
  166.       End
  167.       Begin MSComDlg.CommonDialog Getfile 
  168.          Left            =   120
  169.          Top             =   3840
  170.          _version        =   65536
  171.          _extentx        =   847
  172.          _extenty        =   847
  173.          _stockprops     =   0
  174.       End
  175.       Begin VB.Shape Shape1 
  176.          Height          =   2055
  177.          Left            =   5040
  178.          Shape           =   4  'Rounded Rectangle
  179.          Top             =   2640
  180.          Width           =   2295
  181.       End
  182.       Begin VB.Label Label9 
  183.          Caption         =   "Product Photo:"
  184.          Height          =   255
  185.          Left            =   120
  186.          TabIndex        =   9
  187.          Top             =   2880
  188.          Width           =   1095
  189.       End
  190.       Begin VB.Label Label8 
  191.          Caption         =   "Quantity On Hand:"
  192.          Height          =   255
  193.          Left            =   4320
  194.          TabIndex        =   8
  195.          Top             =   2160
  196.          Width           =   1455
  197.       End
  198.       Begin VB.Label Label7 
  199.          Caption         =   "Minimum Desired Inventory Quantity:"
  200.          Height          =   255
  201.          Left            =   240
  202.          TabIndex        =   7
  203.          Top             =   2160
  204.          Width           =   2655
  205.       End
  206.       Begin VB.Label Label6 
  207.          Caption         =   "Retail Price:"
  208.          Height          =   255
  209.          Left            =   3480
  210.          TabIndex        =   6
  211.          Top             =   1560
  212.          Width           =   975
  213.       End
  214.       Begin VB.Label Label5 
  215.          Caption         =   "Wholesale Price:"
  216.          Height          =   255
  217.          Left            =   240
  218.          TabIndex        =   5
  219.          Top             =   1560
  220.          Width           =   1335
  221.       End
  222.       Begin VB.Label Label4 
  223.          Caption         =   "Product Supplier:"
  224.          Height          =   255
  225.          Left            =   3960
  226.          TabIndex        =   4
  227.          Top             =   960
  228.          Width           =   1335
  229.       End
  230.       Begin VB.Label Label3 
  231.          Caption         =   "Product Category:"
  232.          Height          =   255
  233.          Left            =   240
  234.          TabIndex        =   3
  235.          Top             =   960
  236.          Width           =   1335
  237.       End
  238.       Begin VB.Label Label2 
  239.          Caption         =   "Item Description:"
  240.          Height          =   255
  241.          Left            =   2520
  242.          TabIndex        =   2
  243.          Top             =   360
  244.          Width           =   1215
  245.       End
  246.       Begin VB.Label Label1 
  247.          Caption         =   "Item Code:"
  248.          Height          =   255
  249.          Left            =   240
  250.          TabIndex        =   1
  251.          Top             =   360
  252.          Width           =   855
  253.       End
  254.    End
  255.    Begin VB.Data Items 
  256.       Caption         =   "Retail Items"
  257.       Connect         =   "Access"
  258.       DatabaseName    =   "TRITON2.MDB"
  259.       Exclusive       =   0   'False
  260.       Height          =   285
  261.       Left            =   2880
  262.       Options         =   0
  263.       ReadOnly        =   0   'False
  264.       RecordsetType   =   0  'Table
  265.       RecordSource    =   "Retail Items"
  266.       Top             =   5160
  267.       Width           =   3015
  268.    End
  269.    Begin VB.PictureBox Picture3 
  270.       Height          =   4935
  271.       Left            =   0
  272.       ScaleHeight     =   4905
  273.       ScaleWidth      =   8385
  274.       TabIndex        =   23
  275.       Top             =   120
  276.       Visible         =   0   'False
  277.       Width           =   8415
  278.       Begin MSDBGrid.DBGrid DBGrid1 
  279.          Bindings        =   "CHAPTER5.frx":0000
  280.          Height          =   4695
  281.          Left            =   0
  282.          OleObjectBlob   =   "CHAPTER5.frx":000E
  283.          TabIndex        =   25
  284.          Top             =   120
  285.          Width           =   8295
  286.       End
  287.    End
  288. Attribute VB_Name = "Form1"
  289. Attribute VB_Creatable = False
  290. Attribute VB_Exposed = False
  291. Dim Ordfl As Integer, Browfl As Integer
  292. Private Sub Command1_Click()
  293.     Items.Recordset.AddNew
  294. End Sub
  295. Private Sub Command2_Click()
  296.     Items.Recordset.DELETE
  297.     If Not Items.Recordset.EOF Then
  298.         Items.Recordset.MoveNext
  299.         If Items.Recordset.EOF Then Items.Recordset.MoveLast
  300.     Else
  301.         Items.Recordset.MoveLast
  302.     End If
  303. End Sub
  304. Private Sub Command3_Click()
  305.     Getfile.Filter = "Bitmap Files (*.BMP)|*.bmp|Icon Files | *.ico |All Files|*.*"
  306.     Getfile.DefaultExt = "BMP"
  307.     Getfile.ShowOpen
  308.     DataName = Getfile.filename
  309.     Picture2.picture = LoadPicture(DataName)
  310. End Sub
  311. Private Sub Command4_Click()
  312.     If Browfl = 1 Then
  313.         Picture1.Visible = False
  314.         Picture3.Visible = True
  315.         Command4.Caption = "Single Record Mode"
  316.         Browfl = 2
  317.     Else
  318.         Picture3.Visible = False
  319.         Picture1.Visible = True
  320.         Command4.Caption = "Browse Mode"
  321.         Browfl = 1
  322.     End If
  323. End Sub
  324. Private Sub Command5_Click()
  325.     If Ordfl = 1 Then
  326.         Items.Recordset.Index = "Price"
  327.         Command5.Caption = "Show in Item Code Order"
  328.         Ordfl = 2
  329.     Else
  330.         Items.Recordset.Index = "Items"
  331.         Command5.Caption = "Show in Price Order"
  332.         Ordfl = 1
  333.     End If
  334. End Sub
  335. Private Sub Command6_Click()
  336.     Dim addrc2 As String
  337.     addrc2 = Items.Recordset.Bookmark
  338.     Form2.Show 1
  339.     If Seekac = 1 Then
  340.         Indnam = Items.Recordset.Index
  341.         Items.Recordset.Index = "Items"
  342.         Items.Recordset.Seek "=", Seeknm
  343.         If Not Items.Recordset.NoMatch Then
  344.             addrc2 = Items.Recordset.Bookmark
  345.         End If
  346.         Items.Recordset.Index = Indnam
  347.         Items.Recordset.Bookmark = addrc2
  348.         Seekac = 2
  349.     End If
  350. End Sub
  351. Private Sub Form_Activate()
  352.     Ordfl = 1
  353.     Browfl = 1
  354.     Items.Recordset.Index = "Items"
  355.     'Add items to Product Category List
  356.     Combo1.AddItem "Aquariums"
  357.     Combo1.AddItem "Fish - FW"
  358.     Combo1.AddItem "Fish - SW"
  359.     Combo1.AddItem "Plants"
  360.     Combo1.AddItem "Supplies"
  361. End Sub
  362. Private Sub Form_Load()
  363.     Items.DatabaseName = App.Path & "\triton2.mdb"
  364.     Supplier.DatabaseName = App.Path & "\triton2.mdb"
  365. End Sub
  366. Private Sub Items_Validate(Action As Integer, Save As Integer)
  367.     If Seekac = 2 Then
  368.         Action = vbDataActionCancel
  369.         Seekac = 0
  370.     End If
  371. End Sub
  372.