home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbpxen / return.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-10-23  |  4.6 KB  |  169 lines

  1. VERSION 2.00
  2. Begin Form ReturnForm 
  3.    Caption         =   "Return"
  4.    ClientHeight    =   4875
  5.    ClientLeft      =   1050
  6.    ClientTop       =   1485
  7.    ClientWidth     =   5280
  8.    Height          =   5280
  9.    Left            =   990
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4875
  15.    ScaleWidth      =   5280
  16.    Top             =   1140
  17.    Width           =   5400
  18.    Begin CommandButton ButtonCancel 
  19.       Caption         =   "&Cancel"
  20.       Height          =   615
  21.       Left            =   2520
  22.       TabIndex        =   2
  23.       Top             =   2760
  24.       Width           =   1095
  25.    End
  26.    Begin CommandButton ButtonOK 
  27.       Caption         =   "&OK"
  28.       FontBold        =   -1  'True
  29.       FontItalic      =   0   'False
  30.       FontName        =   "MS Sans Serif"
  31.       FontSize        =   9.75
  32.       FontStrikethru  =   0   'False
  33.       FontUnderline   =   0   'False
  34.       Height          =   615
  35.       Left            =   120
  36.       TabIndex        =   1
  37.       Top             =   2760
  38.       Width           =   1095
  39.    End
  40.    Begin TextBox tapenumber 
  41.       Height          =   375
  42.       Left            =   120
  43.       TabIndex        =   0
  44.       Text            =   " "
  45.       Top             =   720
  46.       Width           =   1095
  47.    End
  48.    Begin Label custname 
  49.       BorderStyle     =   1  'Fixed Single
  50.       Caption         =   " "
  51.       Height          =   375
  52.       Left            =   1560
  53.       TabIndex        =   5
  54.       Top             =   1800
  55.       Width           =   3615
  56.    End
  57.    Begin Label custnumber 
  58.       BorderStyle     =   1  'Fixed Single
  59.       Caption         =   " "
  60.       Height          =   375
  61.       Left            =   120
  62.       TabIndex        =   7
  63.       Top             =   1800
  64.       Width           =   1095
  65.    End
  66.    Begin Label Label1 
  67.       Caption         =   "Customer:"
  68.       Height          =   255
  69.       Left            =   120
  70.       TabIndex        =   3
  71.       Top             =   1440
  72.       Width           =   1095
  73.    End
  74.    Begin Label tapetitle 
  75.       BorderStyle     =   1  'Fixed Single
  76.       Height          =   375
  77.       Left            =   1560
  78.       TabIndex        =   6
  79.       Top             =   720
  80.       Width           =   3615
  81.    End
  82.    Begin Label Label2 
  83.       Caption         =   "Tape number:"
  84.       Height          =   255
  85.       Left            =   120
  86.       TabIndex        =   4
  87.       Top             =   240
  88.       Width           =   1335
  89.    End
  90. Sub ButtonCancel_Click ()
  91.     custname.caption = " "
  92.     custnumber.caption = " "
  93.     tapenumber.text = " "
  94.     tapetitle.caption = " "
  95.     returnform.Hide
  96. End Sub
  97. Sub ButtonOK_Click ()
  98.     Dim savecustnum As String
  99.     '
  100.     '  Get the tape and update
  101.     '
  102.     itemrec.itemnumber = tapenumber.text
  103.     rc = GetItemRec(DBKEYED)
  104.     If rc Then
  105.         Beep
  106.         MsgBox "Tape not on database", MB_ICONINFORMATION
  107.         Exit Sub
  108.     End If
  109.     inout$ = Left$(itemrec.inout_code, 1)
  110.     If inout$ <> "O" Then
  111.         Beep
  112.         MsgBox "Tape not out", MB_ICONINFORMATION
  113.         Exit Sub
  114.     End If
  115.     custrec.custnumber = itemrec.custnum
  116.     '
  117.     '  Change tape status to IN and blank custnum
  118.     '
  119.     itemrec.custnum = " "
  120.     itemrec.inout_code = "IN"
  121.     rc = UpdateItemRec()
  122.     tapetitle.caption = "OK"
  123.                     
  124.     iNumTapes = iNumTapes + 1
  125.     '
  126.     '  Get the customer again and update as quickly
  127.     '  as possible.  Should lock it, but requires more code
  128.     '
  129.     rc = GetCustomerRec(DBKEYED)
  130.     custrec.tapes_out = custrec.tapes_out - 1
  131.     rc = UpdateCustomerRec()
  132.     '
  133.     '  Clear the screen for the next return
  134.     '
  135.     custname.caption = " "
  136.     custnumber.caption = " "
  137.     tapenumber.text = " "
  138.     tapetitle.caption = "OK"
  139.     tapenumber.SetFocus
  140.     Exit Sub
  141. End Sub
  142. Sub Form_Load ()
  143.     custname.caption = " "
  144.     tapenumber.text = " "
  145.     tapetitle.caption = " "
  146. End Sub
  147. Sub tapenumber_LostFocus ()
  148.     If tapenumber.text = " " Then
  149.         Exit Sub
  150.     End If
  151.     itemrec.itemnumber = tapenumber.text
  152.     rc = GetItemRec(DBKEYED)
  153.     If rc Then
  154.         Beep
  155.         tapetitle.caption = "???"
  156.         Exit Sub
  157.     End If
  158.     tapetitle.caption = itemrec.itemdesc
  159.     custnumber.caption = itemrec.custnum
  160.     custrec.custnumber = itemrec.custnum
  161.     rc = GetCustomerRec(DBKEYED)
  162.     If rc Then
  163.         Beep
  164.         custname.caption = "???"
  165.         Exit Sub
  166.     End If
  167.     custname.caption = custrec.lastname
  168. End Sub
  169.