📄 frmgysinfo.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmgysinfo
BorderStyle = 3 'Fixed Dialog
Caption = "供应商信息"
ClientHeight = 6000
ClientLeft = 45
ClientTop = 330
ClientWidth = 7815
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6000
ScaleWidth = 7815
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame2
Caption = "供应商信息浏览"
Height = 4575
Left = 120
TabIndex = 6
Top = 360
Width = 7575
Begin MSFlexGridLib.MSFlexGrid msgList
Height = 4215
Left = 120
TabIndex = 7
Top = 240
Width = 7335
_ExtentX = 12938
_ExtentY = 7435
_Version = 393216
AllowUserResizing= 1
End
End
Begin VB.Frame Frame1
Height = 855
Left = 120
TabIndex = 1
Top = 5040
Width = 7575
Begin VB.CommandButton Command4
Caption = "返回"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5760
TabIndex = 5
Top = 240
Width = 1455
End
Begin VB.CommandButton Command3
Caption = "删除"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 4
Top = 240
Width = 1455
End
Begin VB.CommandButton Command2
Caption = "修改"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2040
TabIndex = 3
Top = 240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "添加"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 2
Top = 240
Width = 1455
End
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "供应商信息浏览"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 255
Left = 2280
TabIndex = 0
Top = 120
Width = 3255
End
End
Attribute VB_Name = "frmgysinfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2006/12/06
'描 述: 纯净水进销存管理系统 Ver 2.0
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
'显示Grid表头
Public Sub ShowTitle()
Dim i As Integer
With msgList
.Cols = 7
.TextMatrix(0, 1) = "供应商编号"
.TextMatrix(0, 2) = "供应商名称"
.TextMatrix(0, 3) = "联系人"
.TextMatrix(0, 4) = "联系电话"
.TextMatrix(0, 5) = "供应商地址"
.TextMatrix(0, 6) = "其它信息"
'固定表头
.FixedRows = 1
'设置各列的对齐方式
For i = 0 To 5
.ColAlignment(i) = 0
Next i
'表头项居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
'设置单元大小
.ColWidth(0) = 500
.ColWidth(1) = 1000
.ColWidth(2) = 2000
.ColWidth(3) = 1000
.ColWidth(4) = 2000
.ColWidth(5) = 3500
.ColWidth(6) = 5000
.Row = 1
End With
End Sub
Public Sub showdata()
On Error GoTo errorhandle
Dim j As Integer
Dim i As Integer
Dim sqlshow As String
Dim mrc As ADODB.Recordset
sqlshow = "select * from 供应商表"
Set mrc = ExeSQL(sqlshow)
If mrc.EOF Then
frmgys.Show 1, frmgysinfo
mrc.Close
Set mrc = Nothing
Exit Sub
End If
With msgList
.Rows = 1
Do While Not mrc.EOF
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
If Not IsNull(Trim(mrc.Fields(i - 1))) Then
Select Case mrc.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
End Select
End If
Next i
mrc.MoveNext
Loop
End With
mrc.Close
Exit Sub
errorhandle:
If Err.Number = 400 Then
Resume Next
End If
End Sub
Private Sub msgList_EnterCell()
msgList.SelectionMode = flexSelectionByRow
End Sub
Private Sub Command1_Click()
Load frmgys
frmgys.Show 1, frmgysinfo
End Sub
Private Sub Command2_Click()
Dim intCount As Integer
Dim txtsql As String
If msgList.Rows > 1 Then
'gintDHmode = 2
intCount = msgList.Row
If intCount > 0 Then
txtsql = "select * from 供应商表 where 供应商编号 ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
Load frmgys
frmgys.showdata (txtsql)
frmgys.Show 1, frmgysinfo
Else
MsgBox "警告", vbOKOnly + vbExclamation, "请首先选择需要修改的纪录!"
End If
End If
End Sub
Private Sub Command3_Click()
Dim txtsql As String
Dim intCount As Integer
Dim MsgText As String
If msgList.Rows > 1 Then
If MsgBox("确认要删除编号为" & Trim(msgList.TextMatrix(msgList.Row, 1)) & "的供应商记录吗?", vbOKCancel + vbExclamation, "警告") = vbOK Then
intCount = msgList.Row
txtsql = "delete from 供应商表 where 供应商编号 ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
ExeSQL (txtsql)
'txtsql = "delete from 进货表 where 供应商编号 ='" & Trim(msgList.TextMatrix(intCount, 1)) & "'"
'ExeSQL (txtsql)
MsgBox "记录删除成功!", vbInformation, "系统提示"
Call showdata
msgList.Refresh
End If
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_Load()
ShowTitle
showdata
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -