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

📄 wanglaidanwei.frm

📁 一个医药进存销程序
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form wanglaidanwei 
   Caption         =   "往来单位管理"
   ClientHeight    =   6045
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   10125
   LinkTopic       =   "Form1"
   ScaleHeight     =   6045
   ScaleWidth      =   10125
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      BackColor       =   &H8000000A&
      Height          =   2295
      Left            =   0
      TabIndex        =   9
      Top             =   0
      Width           =   10095
      Begin VB.TextBox Text6 
         Height          =   375
         Left            =   7560
         TabIndex        =   5
         Top             =   960
         Width           =   2295
      End
      Begin VB.TextBox Text5 
         Height          =   375
         Left            =   3480
         TabIndex        =   4
         Top             =   840
         Width           =   2655
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   600
         TabIndex        =   3
         Top             =   840
         Width           =   1815
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   7560
         TabIndex        =   2
         Top             =   360
         Width           =   2295
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00FFFFFF&
         Height          =   375
         Left            =   1080
         TabIndex        =   0
         Top             =   240
         Width           =   2415
      End
      Begin VB.TextBox Text2 
         ForeColor       =   &H00000000&
         Height          =   375
         Left            =   4560
         TabIndex        =   1
         Top             =   240
         Width           =   1575
      End
      Begin VB.CommandButton Command1 
         Caption         =   "保存"
         Height          =   495
         Left            =   4320
         TabIndex        =   7
         Top             =   1440
         Width           =   855
      End
      Begin VB.CommandButton Command2 
         Caption         =   "退出"
         Height          =   495
         Left            =   6480
         TabIndex        =   8
         Top             =   1440
         Width           =   855
      End
      Begin VB.CommandButton Command3 
         Caption         =   "添加"
         Height          =   495
         Left            =   1800
         TabIndex        =   6
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "往来单位:"
         Height          =   255
         Left            =   120
         TabIndex        =   16
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label2 
         Caption         =   "联系地址:"
         Height          =   255
         Left            =   6360
         TabIndex        =   15
         Top             =   960
         Width           =   975
      End
      Begin VB.Label Label3 
         Caption         =   "联系人:"
         Height          =   255
         Left            =   3600
         TabIndex        =   14
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label4 
         Caption         =   "税号:"
         Height          =   375
         Left            =   120
         TabIndex        =   13
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label Label5 
         Caption         =   "联系电话:"
         Height          =   375
         Left            =   6360
         TabIndex        =   12
         Top             =   360
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "开户帐号:"
         Height          =   255
         Left            =   2520
         TabIndex        =   11
         Top             =   960
         Width           =   975
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   3615
      Left            =   0
      TabIndex        =   10
      Top             =   2400
      Width           =   10095
      _ExtentX        =   17806
      _ExtentY        =   6376
      _Version        =   393216
   End
End
Attribute VB_Name = "wanglaidanwei"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Trecordset As New ADODB.Recordset
Sub Gridflex()
 'init the headers of the msflexgrid1
    MSFlexGrid1.Cols = 7
    
    MSFlexGrid1.TextMatrix(0, 0) = "编号"
    MSFlexGrid1.TextMatrix(0, 1) = "往来单位"
    MSFlexGrid1.TextMatrix(0, 2) = "联系人"
    MSFlexGrid1.TextMatrix(0, 3) = "联系电话"
    MSFlexGrid1.TextMatrix(0, 4) = "税号"
    MSFlexGrid1.TextMatrix(0, 5) = "开户帐号"
    MSFlexGrid1.TextMatrix(0, 6) = "联系地址"
    
    
    MSFlexGrid1.ColWidth(0) = 500
    MSFlexGrid1.ColWidth(1) = 2100
    MSFlexGrid1.ColWidth(2) = 900
    MSFlexGrid1.ColWidth(3) = 2100
    MSFlexGrid1.ColWidth(4) = 1100
    MSFlexGrid1.ColWidth(5) = 2100
    MSFlexGrid1.ColWidth(6) = 2100
   
    MSFlexGrid1.Rows = Trecordset.RecordCount + 1
    If Trecordset.RecordCount > 0 Then Trecordset.MoveFirst
    t = 1
    Do While Not Trecordset.EOF
       MSFlexGrid1.TextMatrix(t, 0) = Trecordset.Fields("id")
       MSFlexGrid1.TextMatrix(t, 1) = Trecordset.Fields("name")
       MSFlexGrid1.TextMatrix(t, 2) = Trecordset.Fields("lianxiren")
       MSFlexGrid1.TextMatrix(t, 3) = Trecordset.Fields("tel")
       MSFlexGrid1.TextMatrix(t, 4) = Trecordset.Fields("shuihao")
       MSFlexGrid1.TextMatrix(t, 5) = Trecordset.Fields("zhanghao")
       MSFlexGrid1.TextMatrix(t, 6) = Trecordset.Fields("dizhi")
      
       Trecordset.MoveNext
       t = t + 1
    Loop
End Sub
Private Sub Command1_Click()
   ' Do While Not Trecordset.EOF
    If Trim(Text1.Text) = "" Then
       MsgBox "往来单位不能为空!", vbOKOnly, "提示"
       Exit Sub
    End If
    If Trim(Text2.Text) = "" Then
       MsgBox "联系人不能为空!", vbOKOnly, "提示"
       Exit Sub
    End If
    If Trim(Text3.Text) = "" Then
       MsgBox "联系电话不能为空!", vbOKOnly, "提示"
       Exit Sub
    End If
    If Trim(Text4.Text) = "" Then
       MsgBox "税号电话不能为空!", vbOKOnly, "提示"
       Exit Sub
    End If
    If Trim(Text5.Text) = "" Then
       MsgBox "帐号不能为空!", vbOKOnly, "提示"
       Exit Sub
    End If
    If Trim(Text6.Text) = "" Then
       MsgBox "地址不能为空!", vbOKOnly, "提示"
       Exit Sub
    End If

    Trecordset.AddNew
    Trecordset.Fields("name") = Trim(Text1.Text)
    Trecordset.Fields("lianxiren") = Trim(Text2.Text)
    Trecordset.Fields("tel") = Trim(Text3.Text)
    Trecordset.Fields("shuihao") = Trim(Text4.Text)
    Trecordset.Fields("zhanghao") = Trim(Text5.Text)
    Trecordset.Fields("dizhi") = Trim(Text6.Text)
    '   Trecordset.MoveNext
   ' Loop
    Trecordset.Update
    Trecordset.Requery
    Text1.Enabled = False
    Text2.Enabled = False
    Text3.Enabled = False
    Text4.Enabled = False
    Text5.Enabled = False
    Text6.Enabled = False
    
Text1.BackColor = &H80000004
Text2.BackColor = &H80000004
Text3.BackColor = &H80000004
Text4.BackColor = &H80000004
Text5.BackColor = &H80000004
Text6.BackColor = &H80000004

Command3.Enabled = True
Command1.Enabled = False
Unload Me
Load wanglaidanwei
wanglaidanwei.Show
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Command3_Click()
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True

Command1.Enabled = True
Text1.BackColor = &HFFFFFF
Text2.BackColor = &HFFFFFF
Text3.BackColor = &HFFFFFF
Text4.BackColor = &HFFFFFF
Text5.BackColor = &HFFFFFF
Text6.BackColor = &HFFFFFF

Command3.Enabled = False
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
    '********
    'open the DSN
    With Trecordset
         Set .ActiveConnection = SGWConnection
         .CursorLocation = adUseServer
         .CursorType = adOpenKeyset
         .LockType = adLockOptimistic
         .Source = "Select * from wanglaidanwei order by id desc"
         .Open
    End With
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False

Command1.Enabled = False
Text1.BackColor = &H80000004
Text2.BackColor = &H80000004
Text3.BackColor = &H80000004
Text4.BackColor = &H80000004
Text5.BackColor = &H80000004
Text6.BackColor = &H80000004

Gridflex
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Trecordset.Close
    Set Trecordset = Nothing
End Sub

Private Sub MSFlexGrid1_Click()
       wanglaidanweiID = Trim(MSFlexGrid1.TextMatrix(MSFlexGrid1.RowSel, 0))
       Load wanglaidanweiModify
       wanglaidanweiModify.Show
       Unload wanglaidanwei
End Sub

⌨️ 快捷键说明

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