www.pudn.com > 通用库存管理系统 vb.rar > frmRK.frm


VERSION 5.00 
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX" 
Object = "{D959C709-8613-11D1-9840-002078110E7D}#1.0#0"; "as97Popup.ocx" 
Begin VB.Form frmRK  
   BorderStyle     =   0  'None 
   Caption         =   "           登  录" 
   ClientHeight    =   4725 
   ClientLeft      =   2790 
   ClientTop       =   3150 
   ClientWidth     =   6765 
   ControlBox      =   0   'False 
   FillColor       =   &H00404040& 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MDIChild        =   -1  'True 
   MinButton       =   0   'False 
   ScaleHeight     =   315 
   ScaleMode       =   3  'Pixel 
   ScaleWidth      =   451 
   ShowInTaskbar   =   0   'False 
   Begin VB.Timer Timer3  
      Left            =   6000 
      Top             =   3000 
   End 
   Begin VB.Timer Timer2  
      Left            =   240 
      Top             =   3240 
   End 
   Begin VB.Data Data5  
      Caption         =   "Data5" 
      Connect         =   "Access" 
      DatabaseName    =   "C:\Documents and Settings\LeeKing\桌面\通用库管\库存管理.mdb" 
      DefaultCursorType=   0  '缺省游标 
      DefaultType     =   2  '使用 ODBC 
      Exclusive       =   0   'False 
      Height          =   345 
      Left            =   480 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "入库表" 
      Top             =   3960 
      Width           =   1695 
   End 
   Begin VB.TextBox Text2  
      ForeColor       =   &H00FF8080& 
      Height          =   270 
      Left            =   3600 
      TabIndex        =   15 
      Text            =   "0.00" 
      Top             =   2520 
      Width           =   2415 
   End 
   Begin VB.TextBox Text1  
      ForeColor       =   &H00FF8080& 
      Height          =   270 
      Left            =   720 
      TabIndex        =   14 
      Text            =   "0" 
      Top             =   2520 
      Width           =   2295 
   End 
   Begin VB.Data Data4  
      Caption         =   "Data4" 
      Connect         =   "Access" 
      DatabaseName    =   "C:\WINDOWS\Desktop\通用库管\库存管理.mdb" 
      DefaultCursorType=   0  '缺省游标 
      DefaultType     =   2  '使用 ODBC 
      Exclusive       =   0   'False 
      Height          =   285 
      Left            =   4680 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "员工表" 
      Top             =   3000 
      Width           =   1215 
   End 
   Begin MSDBCtls.DBCombo DBCombo4  
      Bindings        =   "frmRK.frx":0000 
      Height          =   330 
      Left            =   3600 
      TabIndex        =   11 
      Top             =   3360 
      Width           =   2415 
      _ExtentX        =   4260 
      _ExtentY        =   582 
      _Version        =   393216 
      ForeColor       =   16744576 
      ListField       =   "姓名" 
      BoundColumn     =   "姓名" 
      Text            =   "" 
   End 
   Begin VB.Data Data3  
      Caption         =   "Data3" 
      Connect         =   "Access" 
      DatabaseName    =   "C:\WINDOWS\Desktop\通用库管\库存管理.mdb" 
      DefaultCursorType=   0  '缺省游标 
      DefaultType     =   2  '使用 ODBC 
      Exclusive       =   0   'False 
      Height          =   285 
      Left            =   1680 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "供应商表" 
      Top             =   3000 
      Width           =   1140 
   End 
   Begin MSDBCtls.DBCombo DBCombo3  
      Bindings        =   "frmRK.frx":0014 
      Height          =   330 
      Left            =   720 
      TabIndex        =   8 
      Top             =   3360 
      Width           =   2295 
      _ExtentX        =   4048 
      _ExtentY        =   582 
      _Version        =   393216 
      ForeColor       =   16744576 
      ListField       =   "名称" 
      BoundColumn     =   "名称" 
      Text            =   "" 
   End 
   Begin VB.Timer Timer1  
      Left            =   3000 
      Top             =   1200 
   End 
   Begin VB.Data Data2  
      Caption         =   "Data2" 
      Connect         =   "Access" 
      DatabaseName    =   "C:\WINDOWS\Desktop\通用库管\库存管理.mdb" 
      DefaultCursorType=   0  '缺省游标 
      DefaultType     =   2  '使用 ODBC 
      Exclusive       =   0   'False 
      Height          =   375 
      Left            =   3840 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "库存材料表" 
      Top             =   1200 
      Width           =   1935 
   End 
   Begin MSDBCtls.DBCombo DBCombo2  
      Bindings        =   "frmRK.frx":0028 
      Height          =   330 
      Left            =   3480 
      TabIndex        =   2 
      Top             =   960 
      Width           =   2535 
      _ExtentX        =   4471 
      _ExtentY        =   582 
      _Version        =   393216 
      ForeColor       =   16744576 
      ListField       =   "名称" 
      Text            =   "" 
   End 
   Begin VB.Data Data1  
      Caption         =   "Data1" 
      Connect         =   "Access" 
      DatabaseName    =   "C:\WINDOWS\Desktop\通用库管\库存管理.mdb" 
      DefaultCursorType=   0  '缺省游标 
      DefaultType     =   2  '使用 ODBC 
      Exclusive       =   0   'False 
      Height          =   375 
      Left            =   960 
      Options         =   0 
      ReadOnly        =   0   'False 
      RecordsetType   =   1  'Dynaset 
      RecordSource    =   "材料分类表" 
      Top             =   1200 
      Width           =   1935 
   End 
   Begin MSDBCtls.DBCombo DBCombo1  
      Bindings        =   "frmRK.frx":003C 
      Height          =   330 
      Left            =   720 
      TabIndex        =   1 
      Top             =   960 
      Width           =   2295 
      _ExtentX        =   4048 
      _ExtentY        =   582 
      _Version        =   393216 
      ForeColor       =   16744576 
      ListField       =   "分类" 
      Text            =   "" 
   End 
   Begin as97Popup.asPopup asPopup3  
      Height          =   615 
      Left            =   2400 
      ToolTipText     =   "校验设备" 
      Top             =   3840 
      Width           =   735 
      _ExtentX        =   1296 
      _ExtentY        =   1085 
      CustomPicture   =   "frmRK.frx":0050 
      MouseOverPicture=   "frmRK.frx":092A 
      MouseDownPicture=   "frmRK.frx":1204 
      Caption         =   "" 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   65535 
      BackColor       =   14737632 
      MaskColor       =   14737632 
      UseFrame        =   0   'False 
      MouseOverColor  =   16776960 
      MouseDownColor  =   255 
      ScaleWidth      =   49 
      ScaleMode       =   0 
      BackStyle       =   0 
      Object.ToolTipText     =   "校验设备" 
   End 
   Begin as97Popup.asPopup asPopup4  
      Height          =   495 
      Left            =   3600 
      Top             =   3840 
      Width           =   615 
      _ExtentX        =   1085 
      _ExtentY        =   873 
      CustomPicture   =   "frmRK.frx":151E 
      MouseOverPicture=   "frmRK.frx":21F8 
      MouseDownPicture=   "frmRK.frx":2ED2 
      Caption         =   "" 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      UseFrame        =   0   'False 
      ScaleWidth      =   41 
      ScaleMode       =   0 
      ScaleHeight     =   33 
      BackStyle       =   0 
   End 
   Begin VB.Label Label9  
      BackStyle       =   0  'Transparent 
      Caption         =   "单价:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   3600 
      TabIndex        =   13 
      Top             =   2280 
      Width           =   615 
   End 
   Begin VB.Label Label8  
      BackStyle       =   0  'Transparent 
      Caption         =   "数量:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   720 
      TabIndex        =   12 
      Top             =   2280 
      Width           =   615 
   End 
   Begin VB.Line Line1  
      BorderColor     =   &H00FFC0C0& 
      BorderWidth     =   3 
      X1              =   8 
      X2              =   432 
      Y1              =   136 
      Y2              =   136 
   End 
   Begin VB.Label Label7  
      BackStyle       =   0  'Transparent 
      Caption         =   "经手人:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   3600 
      TabIndex        =   10 
      Top             =   3000 
      Width           =   735 
   End 
   Begin VB.Label Label6  
      BackStyle       =   0  'Transparent 
      Caption         =   "供应商:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   720 
      TabIndex        =   9 
      Top             =   3000 
      Width           =   855 
   End 
   Begin VB.Label Label5  
      BackStyle       =   0  'Transparent 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   3720 
      TabIndex        =   7 
      Top             =   1680 
      Width           =   615 
   End 
   Begin VB.Label Label4  
      Alignment       =   2  'Center 
      BackStyle       =   0  'Transparent 
      ForeColor       =   &H000000FF& 
      Height          =   255 
      Left            =   2880 
      TabIndex        =   6 
      Top             =   1680 
      Width           =   735 
   End 
   Begin VB.Label Label3  
      BackStyle       =   0  'Transparent 
      Caption         =   "库存量:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   2040 
      TabIndex        =   5 
      Top             =   1680 
      Width           =   735 
   End 
   Begin VB.Label Label2  
      BackStyle       =   0  'Transparent 
      Caption         =   "名称:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   3480 
      TabIndex        =   4 
      Top             =   600 
      Width           =   735 
   End 
   Begin VB.Label Label1  
      BackStyle       =   0  'Transparent 
      Caption         =   "分类:" 
      ForeColor       =   &H00FF0000& 
      Height          =   255 
      Left            =   720 
      TabIndex        =   3 
      Top             =   600 
      Width           =   735 
   End 
   Begin VB.Image imgTitleHelp  
      Height          =   195 
      Left            =   9960 
      Picture         =   "frmRK.frx":3BAC 
      Top             =   120 
      Width           =   195 
   End 
   Begin VB.Image imgTitleMinimize  
      Height          =   195 
      Left            =   9960 
      Picture         =   "frmRK.frx":3DF6 
      Top             =   840 
      Width           =   195 
   End 
   Begin VB.Image imgTitleClose  
      Height          =   195 
      Left            =   9960 
      Picture         =   "frmRK.frx":4040 
      Top             =   480 
      Width           =   195 
   End 
   Begin VB.Label lblTitle  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "入库" 
      BeginProperty Font  
         Name            =   "Arial" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FFFFFF& 
      Height          =   240 
      Left            =   9480 
      TabIndex        =   0 
      Top             =   1200 
      Width           =   420 
   End 
   Begin VB.Image imgTitleMain  
      Height          =   450 
      Left            =   8520 
      Picture         =   "frmRK.frx":428A 
      Stretch         =   -1  'True 
      Top             =   600 
      Width           =   285 
   End 
   Begin VB.Image imgWindowBottomRight  
      Height          =   450 
      Left            =   9600 
      Picture         =   "frmRK.frx":49D4 
      Top             =   120 
      Width           =   285 
   End 
   Begin VB.Image imgWindowRight  
      Height          =   450 
      Left            =   9600 
      Picture         =   "frmRK.frx":511E 
      Stretch         =   -1  'True 
      Top             =   600 
      Width           =   285 
   End 
   Begin VB.Image imgWindowLeft  
      Height          =   450 
      Left            =   9240 
      Picture         =   "frmRK.frx":5868 
      Stretch         =   -1  'True 
      Top             =   600 
      Width           =   285 
   End 
   Begin VB.Image imgWindowBottom  
      Height          =   450 
      Left            =   8880 
      Picture         =   "frmRK.frx":5FB2 
      Stretch         =   -1  'True 
      Top             =   600 
      Width           =   285 
   End 
   Begin VB.Image imgWindowBottomLeft  
      Height          =   450 
      Left            =   9240 
      Picture         =   "frmRK.frx":66FC 
      Top             =   120 
      Width           =   285 
   End 
   Begin VB.Image imgTitleRight  
      Height          =   450 
      Left            =   8880 
      Picture         =   "frmRK.frx":6E46 
      Top             =   120 
      Width           =   285 
   End 
   Begin VB.Image imgTitleLeft  
      Height          =   450 
      Left            =   8520 
      Picture         =   "frmRK.frx":7590 
      Top             =   120 
      Width           =   285 
   End 
End 
Attribute VB_Name = "frmRK" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Private Sub asPopup3_Click(Cancel As Boolean) 
If Val(Text1.Text) <= 0 Then 
 MsgBox "请输入入库数量!" 
 Exit Sub 
End If 
If DBCombo2.Text = "" Then 
 MsgBox "请选择入库材料名称!" 
 Exit Sub 
End If 
If DBCombo4.Text = "" Then 
 MsgBox "请选择经手人!" 
 Exit Sub 
End If 
Dim a As Integer 
 a = MsgBox("********你确定此操作吗?**********" & vbCrLf _ 
        & "材料名称:" & DBCombo2.Text & vbCrLf _ 
        & "原库存量:" & Label4.Caption & Label5.Caption & vbCrLf _ 
        & "本次入库:" & Text1.Text & Label5.Caption & "   单价:" & Text2.Text & "元" & vbCrLf _ 
        & "供应商:" & DBCombo3.Text & vbCrLf _ 
        & "经手人:" & DBCombo4.Text & vbCrLf _ 
        , vbExclamation + vbOKCancel + vbApplicationModal, "提示") 
If a = 1 Then 
  Data5.Recordset.AddNew 
  Data5.Recordset("名称") = DBCombo2.Text 
  Data5.Recordset("供应商") = DBCombo3.Text 
  Data5.Recordset("数量") = Text1.Text 
  Data5.Recordset("单价") = Text2.Text 
  Data5.Recordset("经手") = DBCombo4.Text 
  Data5.Recordset("日期") = Date 
  Data5.Recordset("时间") = Time 
  Data5.UpdateRecord 
  Data5.Recordset.Bookmark = Data5.Recordset.LastModified 
  '************************ 
  Data2.Recordset.Edit 
  Data2.Recordset("数量") = Val(Label4.Caption) + Val(Text1.Text) 
  Data2.Recordset.Update 
  MsgBox "入库成功!" 
  asPopup4.Enabled = True 
End If 
If a = 2 Then Exit Sub 
End Sub 
 
Private Sub asPopup4_Click(Cancel As Boolean) 
DataReport1.Show 
DataReport1.Sections(2).Controls("Label1").Caption = "入库单据" 
DataReport1.Sections(2).Controls("Label2").Caption = CStr(DBCombo2.Text) 
DataReport1.Sections(2).Controls("Label3").Caption = "数量:" & CStr(Text1.Text) 
DataReport1.Sections(2).Controls("Label4").Caption = "供应商:" & CStr(DBCombo3.Text) 
DataReport1.Sections(2).Controls("Label5").Caption = "单价:" & CStr(Text2.Text) 
DataReport1.Sections(2).Controls("Label6").Caption = "经手人:" & CStr(DBCombo4.Text) 
DataReport1.Sections(2).Controls("Label7").Caption = "时间:" & CStr(Date) & "  " & CStr(Time) & "  " & CStr(Data5.Recordset("ID")) 
asPopup4.Enabled = False 
End Sub 
 
Private Sub DBCombo2_Click(Area As Integer) 
If DBCombo1.Text = "" Then 
 MsgBox "请先选择类别!" 
 Exit Sub 
End If 
Dim SQL As String 
SQL = "SELECT ID, 分类, 单位, 名称, 备注, 数量 FROM 库存材料表 WHERE 分类 = '" & CStr(DBCombo1.Text) & "'" 
Data2.Visible = False 
Data2.DatabaseName = App.Path & "\库存管理.mdb" 
Data2.RecordSource = SQL 
Data2.Refresh 
DBCombo2.Refresh 
Timer1.Enabled = True 
Timer1.Interval = 2000 
End Sub 
 
Private Sub DBCombo3_Click(Area As Integer) 
Timer2.Enabled = True 
Timer2.Interval = 2000 
End Sub 
 
Private Sub DBCombo4_Click(Area As Integer) 
Timer3.Enabled = True 
Timer3.Interval = 2000 
End Sub 
 
Private Sub Form_Load() 
 MakeWindow Me 
   ' AlwaysOnTop Me, True 
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000 
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2 
Data1.DatabaseName = App.Path & "\库存管理.mdb" 
Data1.Connect = ";pwd=lee1012" 
Data1.RecordSource = "材料分类表" 
Data1.Refresh 
Data1.Visible = False 
Data2.DatabaseName = App.Path & "\库存管理.mdb" 
Data2.Connect = ";pwd=lee1012" 
Data2.RecordSource = "库存材料表" 
Data2.Refresh 
Data2.Visible = False 
Data3.DatabaseName = App.Path & "\库存管理.mdb" 
Data3.Connect = ";pwd=lee1012" 
Data3.RecordSource = "供应商表" 
Data3.Refresh 
Data3.Visible = False 
Data4.DatabaseName = App.Path & "\库存管理.mdb" 
Data4.Connect = ";pwd=lee1012" 
Data4.RecordSource = "员工表" 
Data4.Refresh 
Data4.Visible = False 
Data5.DatabaseName = App.Path & "\库存管理.mdb" 
Data5.Connect = ";pwd=lee1012" 
Data5.RecordSource = "入库表" 
Data5.Refresh 
Data5.Visible = False 
asPopup4.Enabled = False 
End Sub 
 
Private Sub Form_Unload(Cancel As Integer) 
Dim MyStr As String 
MyStr = "通用库存管理由秦通电子有限公司开发" 
MDIFrmMain.MovingText1.MsgChar = MyStr 
End Sub 
 
Private Sub imgTitleClose_Click() 
Unload Me 
End Sub 
 
Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
    DoDrag Me 
End Sub 
 
Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
    DoDrag Me 
End Sub 
 
Private Sub imgTitleMinimize_Click() 
    Me.WindowState = 1 
End Sub 
 
Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
    DoDrag Me 
End Sub 
 
Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
    DoDrag Me 
End Sub 
 
Private Sub Timer1_Timer() 
Data2.Recordset.FindFirst "名称 ='" & DBCombo2.Text & "'" 
If Data2.Recordset.NoMatch = True Then 
  MsgBox "Err", 0, "提示" 
  Timer1.Enabled = False 
  Exit Sub 
Timer1.Enabled = False 
End If 
Label4.Caption = Data2.Recordset("数量") 
Label5.Caption = Data2.Recordset("单位") 
Timer1.Enabled = False 
Dim MyStr As String 
MyStr = CStr(DBCombo2.Text) & "   原库存量" & CStr(Label4.Caption) & CStr(Label5.Caption) 
MDIFrmMain.MovingText1.MsgChar = MyStr 
End Sub 
 
Private Sub Timer2_Timer() 
If DBCombo3.Text = "" Then 
 MsgBox "没有选择供应商!" 
 Timer2.Enabled = False 
 Exit Sub 
End If 
Data3.Recordset.FindFirst "名称 ='" & DBCombo3.Text & "'" 
If Data3.Recordset.NoMatch = True Then 
  MsgBox "Err", 0, "提示" 
  Timer2.Enabled = False 
  Exit Sub 
 
End If 
Dim MyStr As String 
MyStr = CStr(Data3.Recordset("名称")) & "  地址:" & CStr(Data3.Recordset("地址")) & "  联系人:" & CStr(Data3.Recordset("联系人")) & "  电话:" & CStr(Data3.Recordset("电话")) & "  备注:" & CStr(Data3.Recordset("备注")) 
MDIFrmMain.MovingText1.MsgChar = MyStr 
Timer2.Enabled = False 
End Sub 
 
Private Sub Timer3_Timer() 
If DBCombo4.Text = "" Then 
 MsgBox "没有选择供应商!" 
 Timer3.Enabled = False 
 Exit Sub 
End If 
Data4.Recordset.FindFirst "姓名 ='" & DBCombo4.Text & "'" 
If Data4.Recordset.NoMatch = True Then 
  MsgBox "Err", 0, "提示" 
  Timer3.Enabled = False 
  Exit Sub 
End If 
Dim MyStr As String 
MyStr = CStr(Data4.Recordset("姓名")) & "  职务:" & CStr(Data4.Recordset("职务")) & "  电话:" & CStr(Data4.Recordset("电话")) 
MDIFrmMain.MovingText1.MsgChar = MyStr 
Timer2.Enabled = False 
End Sub