📄 frmshujuweihu.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Frmshujuweihu
BackColor = &H0080FF80&
Caption = "数据维护"
ClientHeight = 8490
ClientLeft = 60
ClientTop = 345
ClientWidth = 11805
LinkTopic = "Form2"
ScaleHeight = 8490
ScaleWidth = 11805
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Comprintml
Caption = "打印"
Height = 495
Left = 9000
TabIndex = 7
Top = 7320
Width = 1215
End
Begin VB.Frame Frame1
Caption = "详细资料:"
Height = 6495
Left = 7320
TabIndex = 5
Top = 480
Width = 3495
Begin VB.TextBox Text1
Height = 375
Left = 960
TabIndex = 6
Text = "Text1"
Top = 720
Width = 1215
End
End
Begin VB.CommandButton Command4
Caption = "退出"
Height = 495
Left = 7560
TabIndex = 4
Top = 7320
Width = 1215
End
Begin VB.CommandButton Commodi
Caption = "修改"
Height = 495
Left = 4680
TabIndex = 3
Top = 7320
Width = 1215
End
Begin VB.CommandButton Comdel
Caption = "删除"
Height = 495
Left = 6120
TabIndex = 2
Top = 7320
Width = 1215
End
Begin VB.CommandButton ComADD
Caption = "增加"
Height = 495
Left = 3240
TabIndex = 1
Top = 7320
Width = 1215
End
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Frmshujuweihu.frx":0000
Height = 6495
Left = 480
TabIndex = 0
Top = 480
Width = 6615
_ExtentX = 11668
_ExtentY = 11456
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 720
Top = 7320
Width = 2295
_ExtentX = 4048
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=wei"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select qcdm,mc,dw,kcbz,kcsl from qcml"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "Frmshujuweihu"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private recs As Integer '保存记录集中记录个数
'记录为零时,修改和删除按钮不可用
Private Sub encomm()
recs = Adodc1.Recordset.RecordCount
If recs = 0 Then
Comdel.Enabled = False
Commodi.Enabled = False
Else
Comdel.Enabled = True
Commodi.Enabled = True
End If
End Sub
Private Sub ComADD_Click()
FrmsjwADD.flag = 1 'flag为在 FrmsjwADD中设置的公共变量,可被外部过程引用,但须加上对象名
FrmsjwADD.Show
End Sub
Private Sub Comdel_Click()
Dim str As String
str = "真要删除记录[" & Trim(Adodc1.Recordset.Fields("qcdm")) & Trim(Adodc1.Recordset.Fields("mc")) & "]?"
If MsgBox(str, vbYesNo + vbQuestion, "提示") = vbYes Then
Adodc1.Recordset.Delete
Call encomm
End If
End Sub
Private Sub Command1_Click()
'printgrid1.unit = centimeter
'printgrid1.printobject = DataGrid1
'printgrid1.dopreview
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Commodi_Click()
With Frmxiugai
.flag = 2 '标记为2表示修改
'显示当前记录的信息
.Text1 = Adodc1.Recordset.Fields("qcdm") '两种方式引用字段中的值
.Text2 = Adodc1.Recordset.Fields!mc
.Text3 = Adodc1.Recordset.Fields!dw
.Text4 = Adodc1.Recordset.Fields!kcbz
.Text5 = Adodc1.Recordset.Fields!kcsl
.Caption = "器材目录数据修改"
.Show 1 ' 1表示模式窗体,此时除了模式窗体中的对象之外不能进行输入(键盘或鼠标单击)
End With
End Sub
Private Sub Comprintml_Click()
DataReport1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -