📄 form1.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Object = "{DAAC6951-59A4-4C08-9D6E-FE3919B64861}#1.0#0"; "FlexCell.ocx"
Begin VB.Form Form1
BackColor = &H00FFFFC0&
BorderStyle = 1 'Fixed Single
Caption = "入库单"
ClientHeight = 7365
ClientLeft = 45
ClientTop = 435
ClientWidth = 10335
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 7365
ScaleWidth = 10335
StartUpPosition = 1 '所有者中心
Begin StoneXP.XPButton XPButton8
Height = 375
Left = 480
TabIndex = 10
Top = 6840
Width = 1215
_ExtentX = 2143
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "查 询"
MouseIcon = "Form1.frx":000C
MousePointer = 99
End
Begin StoneXP.XPButton XPButton5
Height = 375
Left = 8760
TabIndex = 4
Top = 6840
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "删 除"
MouseIcon = "Form1.frx":0326
MousePointer = 99
End
Begin StoneXP.XPButton XPButton1
Height = 375
Left = 3360
TabIndex = 0
Top = 6840
Width = 1455
_ExtentX = 2566
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "历史记录"
MouseIcon = "Form1.frx":0640
MousePointer = 99
End
Begin StoneXP.XPButton XPButton2
Height = 375
Left = 4800
TabIndex = 1
Top = 6840
Width = 1455
_ExtentX = 2566
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "新入库单"
MouseIcon = "Form1.frx":095A
MousePointer = 99
End
Begin StoneXP.XPButton XPButton3
Height = 375
Left = 6240
TabIndex = 2
Top = 6840
Width = 1455
_ExtentX = 2566
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "增加明细"
MouseIcon = "Form1.frx":0C74
MousePointer = 99
End
Begin StoneXP.XPButton XPButton4
Height = 375
Left = 7680
TabIndex = 3
Top = 6840
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "保 存"
MouseIcon = "Form1.frx":0F8E
MousePointer = 99
End
Begin StoneXP.XPFrame XPFrame1
Height = 1815
Left = 480
TabIndex = 5
Top = 2160
Visible = 0 'False
Width = 9495
_ExtentX = 16748
_ExtentY = 3201
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
BackColor = 16777152
LeftSpace = 5
TopSpace = 5
RightSpace = 5
BottomSpace = 5
CapTionLeft = 50
CaptionTop = 0
RoundSize = 0
Begin StoneXP.XPButton XPButton6
Height = 375
Left = 2280
TabIndex = 6
Top = 1200
Width = 1575
_ExtentX = 2778
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "执行查询"
MouseIcon = "Form1.frx":12A8
MousePointer = 99
End
Begin FlexCell.Grid Grid2
Height = 555
Left = 600
TabIndex = 7
Top = 360
Width = 8535
_ExtentX = 15055
_ExtentY = 979
Appearance = 0
Cols = 6
Rows = 2
ScrollBars = 0
End
Begin StoneXP.XPButton XPButton7
Height = 375
Left = 5040
TabIndex = 8
Top = 1200
Width = 1575
_ExtentX = 2778
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ButtonStyle = 1
Caption = "离开查询"
MouseIcon = "Form1.frx":15C2
MousePointer = 99
End
End
Begin FlexCell.Grid Grid1
Height = 6615
Left = 120
TabIndex = 9
Top = 120
Width = 10095
_ExtentX = 17806
_ExtentY = 11668
Appearance = 0
Cols = 10
Rows = 1
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim addmx As Boolean '确定当前是否可以增加明细
Dim yxsave As Boolean
Dim yxdel As Boolean
Dim gcolor1, gcolor2 As String
Dim m, n As Integer
Private Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Integer '这个API实现在表格控件中TAB键使用下移到下一单元格
Private Sub Form_Load()
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '进行注册
Grid1.Column(0).Width = 50
Grid1.Column(2).Width = 115
Grid1.Column(6).Width = 100
Grid1.Column(7).Width = 100
Grid1.Column(8).Width = 60
Grid1.Column(7).CellType = cellComboBox
yxsql = "select * from 入库单"
yxnumber = 13 '设定入库表中有多少个字段,在这里使用变量是防止以后程序修改后只需要修改
'这个关键字就可以了
Grid1.Cols = yxnumber + 1
Set yx2 = cnn.Execute(yxsql) '执行某一SQL语句,并将结果返回到记录集YX2
For i = 1 To Grid1.Cols - 1
Grid1.Cell(0, i).Text = yx2.Fields(i - 1).Name
Next
'*********查询控件的配置
'********************
Grid2.AllowUserResizing = False
Grid2.DisplayFocusRect = False '改变输入模式为平面
Grid2.Column(0).Width = 0
Grid2.Column(2).Width = 100
Grid2.Column(4).Width = 108
Grid2.Column(5).Width = 200
Grid2.Column(1).CellType = cellComboBox
Grid2.Column(2).CellType = cellComboBox
Grid2.Column(3).CellType = cellComboBox
Grid2.Cell(0, 1).Text = "查询模式" '将表格内添入固定内容
Grid2.Cell(0, 2).Text = "查询段"
Grid2.Cell(0, 3).Text = "条件"
Grid2.Cell(0, 4).Text = "关键字"
Grid2.Cell(0, 5).Text = "附加条件"
Grid2.ComboBox(1).AddItem "精确查询" '这里是类似combo框的操作,也是把内容添入combo控件的记录集
Grid2.ComboBox(1).AddItem "模糊查询"
Set yx2 = cnn.Execute("select * from 入库单")
For i = 1 To Grid1.Cols - 1
Grid2.ComboBox(2).AddItem yx2.Fields(i - 1).Name
Next
'********************
End Sub
Private Sub Form_Unload(Cancel As Integer)
Formmain.WindowState = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -