⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kucunpandianmodify.frm

📁 一个医药进存销程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form kucunpandianModify 
   Caption         =   "查看管理库存"
   ClientHeight    =   4185
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8940
   LinkTopic       =   "Form1"
   ScaleHeight     =   4185
   ScaleWidth      =   8940
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "退  出"
      Height          =   975
      Left            =   7320
      TabIndex        =   26
      Top             =   2760
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "保  存"
      Height          =   495
      Left            =   7320
      TabIndex        =   25
      Top             =   1920
      Width           =   1455
   End
   Begin VB.CommandButton Command2 
      Caption         =   "删  除"
      Height          =   495
      Left            =   7320
      TabIndex        =   24
      Top             =   1080
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修  改"
      Height          =   495
      Left            =   7320
      TabIndex        =   23
      Top             =   240
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Height          =   4095
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6975
      Begin VB.TextBox Text11 
         Height          =   1215
         Left            =   240
         MultiLine       =   -1  'True
         TabIndex        =   11
         Top             =   2640
         Width           =   6615
      End
      Begin VB.TextBox Text10 
         Height          =   375
         Left            =   1920
         TabIndex        =   10
         Top             =   1920
         Width           =   1815
      End
      Begin VB.TextBox Text9 
         Height          =   375
         Left            =   120
         TabIndex        =   9
         Top             =   1920
         Width           =   1095
      End
      Begin VB.TextBox Text8 
         Height          =   375
         Left            =   5880
         TabIndex        =   8
         Top             =   1200
         Width           =   855
      End
      Begin VB.TextBox Text7 
         Height          =   375
         Left            =   3960
         TabIndex        =   7
         Top             =   1200
         Width           =   1575
      End
      Begin VB.TextBox Text6 
         Height          =   375
         Left            =   1920
         TabIndex        =   6
         Top             =   1200
         Width           =   1815
      End
      Begin VB.TextBox Text5 
         Height          =   375
         Left            =   120
         TabIndex        =   5
         Top             =   1200
         Width           =   1095
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   5880
         TabIndex        =   4
         Top             =   480
         Width           =   855
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   3960
         TabIndex        =   3
         Top             =   480
         Width           =   1575
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   1920
         TabIndex        =   2
         Top             =   480
         Width           =   1815
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   120
         TabIndex        =   1
         Top             =   480
         Width           =   1695
      End
      Begin VB.Label Label11 
         Caption         =   "备注:"
         Height          =   255
         Left            =   240
         TabIndex        =   22
         Top             =   2400
         Width           =   855
      End
      Begin VB.Label Label10 
         Caption         =   "金额:"
         Height          =   375
         Left            =   1920
         TabIndex        =   21
         Top             =   1680
         Width           =   1095
      End
      Begin VB.Label Label9 
         Caption         =   "数量:"
         Height          =   375
         Left            =   240
         TabIndex        =   20
         Top             =   1680
         Width           =   1095
      End
      Begin VB.Label Label8 
         Caption         =   "价格:"
         Height          =   255
         Left            =   5880
         TabIndex        =   19
         Top             =   960
         Width           =   735
      End
      Begin VB.Label Label7 
         Caption         =   "有效日期:"
         Height          =   375
         Left            =   3960
         TabIndex        =   18
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "生产日期:"
         Height          =   255
         Left            =   1920
         TabIndex        =   17
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "剂型:"
         Height          =   255
         Left            =   5880
         TabIndex        =   16
         Top             =   240
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "药品类型:"
         Height          =   255
         Left            =   240
         TabIndex        =   15
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "包装规格:"
         Height          =   255
         Left            =   3960
         TabIndex        =   14
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label2 
         Caption         =   "药品名称:"
         Height          =   255
         Left            =   1920
         TabIndex        =   13
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "往来单位:"
         Height          =   255
         Left            =   240
         TabIndex        =   12
         Top             =   240
         Width           =   1335
      End
   End
End
Attribute VB_Name = "kucunpandianModify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Trecordset3 As New ADODB.Recordset
Sub Bai()
    Text1.Enabled = True
    Text2.Enabled = True
    Text3.Enabled = True
    Text4.Enabled = True
    Text5.Enabled = True
    Text6.Enabled = True
    Text7.Enabled = True
    Text8.Enabled = True
    Text9.Enabled = True
    Text10.Enabled = True
    Text11.Enabled = True
    Command3.Enabled = True
    Text1.BackColor = &HFFFFFF
    Text2.BackColor = &HFFFFFF
    Text3.BackColor = &HFFFFFF
    Text4.BackColor = &HFFFFFF
    Text5.BackColor = &HFFFFFF
    Text6.BackColor = &HFFFFFF
    Text7.BackColor = &HFFFFFF
    Text8.BackColor = &HFFFFFF
    Text9.BackColor = &HFFFFFF
    Text10.BackColor = &HFFFFFF
    Text11.BackColor = &HFFFFFF
End Sub
Sub Hei()
    Text1.Enabled = False
    Text2.Enabled = False
    Text3.Enabled = False
    Text4.Enabled = False
    Text5.Enabled = False
    Text6.Enabled = False
    Text7.Enabled = False
    Text8.Enabled = False
    Text9.Enabled = False
    Text10.Enabled = False
    Text11.Enabled = False
    Command3.Enabled = False
    Text1.BackColor = &H80000004
    Text2.BackColor = &H80000004
    Text3.BackColor = &H80000004
    Text4.BackColor = &H80000004
    Text5.BackColor = &H80000004
    Text6.BackColor = &H80000004
    Text7.BackColor = &H80000004
    Text8.BackColor = &H80000004
    Text9.BackColor = &H80000004
    Text10.BackColor = &H80000004
    Text11.BackColor = &H80000004
End Sub
Sub Gridflex()
    If Trecordset3.State = 1 Then Trecordset3.Close
    With Trecordset3
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from kucun where id= val('" & kucunID & "')  order by id desc"
         .Open
    End With

       Text1.Text = Trecordset3.Fields("wanglaidanwei")
       Text2.Text = Trecordset3.Fields("yaopinming")
       Text8.Text = Trecordset3.Fields("jiage")
       Text9.Text = Trecordset3.Fields("shuliang")
       Text10.Text = Trecordset3.Fields("jine")
       Text3.Text = Trecordset3.Fields("guige")
       Text4.Text = Trecordset3.Fields("jixing")
       Text5.Text = Trecordset3.Fields("leixing")
       Text6.Text = Trecordset3.Fields("shengchanriqi")
       Text7.Text = Trecordset3.Fields("youxiaoqi")

       Text11.Text = Trecordset3.Fields("beizhu")

'    Trecordset3.Close
'    Set Trecordset3 = Nothing
    
End Sub

Private Sub Command1_Click()
    Bai
    Command1.Enabled = False
    Command3.Enabled = True
    Command2.Enabled = False
    Tag = "2"
End Sub

Private Sub Command2_Click()
    Command3.Enabled = True
    Command1.Enabled = False
    Command2.Enabled = False
    Tag = "1"
End Sub

Private Sub Command3_Click()
If Tag = "1" Then
    If MsgBox("您确定删除本条记录吗?", vbYesNo + vbInformation, "提示") = vbYes Then
       Trecordset3.Delete
       Trecordset3.Requery
       Trecordset3.Close
      'DataToScreen
     ' If SGWConnection.State = adStateOpen Then Closconn
       MsgBox "记录已删除!", vbOKOnly + vbInformation, "提示"
       Unload kucunpandianModify

      ' Unload Me
    End If
ElseIf Tag = "2" Then
       Trecordset3.Fields("wanglaidanwei") = Text1.Text
       Trecordset3.Fields("yaopinming") = Text2.Text
       Trecordset3.Fields("jiage") = Text8.Text
       Trecordset3.Fields("shuliang") = Text9.Text
       Trecordset3.Fields("jine") = Text10.Text
       Trecordset3.Fields("guige") = Text3.Text
       Trecordset3.Fields("jixing") = Text4.Text
       Trecordset3.Fields("leixing") = Text5.Text
       Trecordset3.Fields("shengchanriqi") = Text6.Text
       Trecordset3.Fields("youxiaoqi") = Text7.Text
       Trecordset3.Fields("beizhu") = Text11.Text
       Trecordset3.Update
       Trecordset3.Requery
       Trecordset3.Close
End If
    Hei
    Command1.Enabled = True
    Command2.Enabled = True
    Command3.Enabled = False
End Sub

Private Sub Command4_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    'set the window in the middle
    Me.Left = (Screen.Width - Me.Width) / 2
    Me.Top = (Screen.Height - Me.Height) / 2
    Hei
    Gridflex
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -