📄 form4.frm
字号:
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "提 交"
MouseIcon = "Form4.frx":129C
MousePointer = 99
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 405
Left = 240
Picture = "Form4.frx":15B6
Top = 720
Width = 1380
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "联系人:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 21
Top = 2445
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "供货商:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 480
TabIndex = 19
Top = 1335
Width = 975
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "结算方式:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 18
Top = 1920
Width = 1215
End
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "制单人:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7800
TabIndex = 15
Top = 7230
Width = 975
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "制单日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4800
TabIndex = 13
Top = 7230
Width = 1215
End
Begin VB.Label Label9
BackStyle = 0 'Transparent
Caption = "采购日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7560
TabIndex = 10
Top = 630
Width = 1215
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "批号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7680
TabIndex = 8
Top = 120
Width = 735
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "采购单号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4080
TabIndex = 6
Top = 120
Width = 1215
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "到货地点:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3840
TabIndex = 3
Top = 2520
Width = 1215
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "合同号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4080
TabIndex = 1
Top = 1920
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "到货时间:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4080
TabIndex = 0
Top = 1335
Width = 1215
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'作者:性灵工作室
'发布日期:2007/03/03
'描 述:简单小型超市采购系统
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Dim intPage As Integer
Dim intPageCount As Integer
Dim intRecord As Integer
Private Sub Form_Load()
Set cg1 = cnn.Execute("select * from 供货商") '这里向xcombox里将所有供货商的姓名填入
xcombox1.Clear
Do While Not cg1.EOF
xcombox1.AddItem cg1.Fields(0)
cg1.MoveNext
Loop
xcombox2.Clear '这里清除以前的xcombox2的内容,并加入新的数据
xcombox2.AddItem "现金"
xcombox2.AddItem "汇票"
xcombox2.AddItem "银行汇票"
xcombox2.AddItem "商业汇票"
'以下是修改显示的表格控件的一些参数,包含颜色,列宽度等
Grid1.AllowUserResizing = True
Grid1.DisplayFocusRect = False
Grid1.ExtendLastCol = True
Grid1.Appearance = Flat
Grid1.FixedRowColStyle = Flat
Grid1.ScrollBarStyle = Flat
Grid1.DefaultFont.Name = "Tahoma"
Grid1.DefaultFont.Size = 8
Grid1.BackColorFixed = RGB(90, 158, 214)
Grid1.BackColorFixedSel = RGB(110, 180, 230)
Grid1.BackColorBkg = RGB(90, 158, 214)
Grid1.BackColorScrollBar = RGB(231, 235, 247)
Grid1.BackColor1 = RGB(231, 235, 247)
Grid1.BackColor2 = RGB(239, 243, 255)
Grid1.GridColor = RGB(148, 190, 231)
Grid1.Cols = 9
Grid1.Column(0).Width = 0
For i = 1 To 8
Grid1.Column(i).Width = 100
Next
Grid1.Column(4).Width = 50
Grid1.Column(5).Width = 50
Grid1.Column(8).Width = 30
'----------------
'以下是设置单元格内哪些列的类型是combox类型或checkbox类型
Grid1.Column(1).CellType = cellComboBox
Grid1.Column(2).CellType = cellComboBox
Grid1.Column(3).CellType = cellComboBox
Grid1.Column(5).CellType = cellComboBox
Grid1.Column(8).CellType = cellCheckBox
'----------------以下为单元格显示每列的数据字段名称
If cg2.State = adStateOpen Then
cg2.Close
End If
cg2.Open "select * from 申购单明细", cnn, adOpenKeyset, adLockReadOnly, adCmdText
For i = 0 To 7
Grid1.Cell(0, i + 1).Text = cg2.Fields(i).Name '.name就是某一列的字段名,这就是为什么表中用中文字段
Next
'--------将商品类型检索并填入单元格中的combox1
Set cg3 = cnn.Execute("select distinct(商品类型) from 商品") 'select distinct是SQL语句中的一个过滤,不会出现同样的商品类型填入记录集
Grid1.ComboBox(1).Clear
Do While cg3.EOF = False
Grid1.ComboBox(1).AddItem cg3.Fields(0)
cg3.MoveNext
Loop
zdcsh '执行订单初始化,这里执行了一个过程,主要是将窗体中各控件内容清空
'--------
'以下使用了ado中的数据分页技术,将所有数据按一页一个进行分页,这样
'就可以在按钮上显示向上有多少条数据,向下有多少条数据了
If cg1.State = adStateOpen Then
cg1.Close
End If
cg1.Open "申购单", cnn, adOpenStatic, adLockReadOnly, adCmdTable
cg1.PageSize = 1 '设置每页记录条数为1
intPageCount = cg1.PageCount
If cg1.PageCount = 0 Then
intPageCount = 1
End If
intPage = cg1.PageCount '当前的页数指向最后一页
If cg1.RecordCount = 0 Then
Exit Sub
End If
cg1.AbsolutePage = intPage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -