📄 frmmend.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmmend
Caption = "维修情况管理"
ClientHeight = 6885
ClientLeft = 60
ClientTop = 450
ClientWidth = 7890
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 6885
ScaleWidth = 7890
WindowState = 2 'Maximized
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 9120
Top = 5040
Width = 1200
_ExtentX = 2117
_ExtentY = 582
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=Microsoft.Jet.OLEDB.4.0;Data Source=F:\公寓管理信息系统\数据.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\公寓管理信息系统\数据.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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
Begin VB.Frame Frame2
Caption = "维修情况"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3735
Left = 360
TabIndex = 1
Top = 2760
Width = 6015
Begin VB.TextBox Text1
Height = 375
Left = 1800
TabIndex = 22
Top = 1440
Width = 3615
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
TabIndex = 20
Top = 840
Width = 1455
End
Begin VB.TextBox Text9
Height = 375
Left = 1800
TabIndex = 19
Top = 3120
Width = 3495
End
Begin VB.CommandButton Command2
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3960
TabIndex = 14
Top = 480
Width = 1215
End
Begin VB.TextBox Text6
Height = 375
Left = 1800
TabIndex = 12
Top = 2520
Width = 3495
End
Begin VB.TextBox Text5
Height = 375
Left = 1800
TabIndex = 11
Top = 2040
Width = 1215
End
Begin VB.TextBox Text4
Height = 375
Left = 1800
TabIndex = 10
Top = 240
Width = 1215
End
Begin VB.Label Label8
Caption = "维修内容:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 23
Top = 1440
Width = 1095
End
Begin VB.Label Label7
Caption = "宿 舍:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 21
Top = 840
Width = 855
End
Begin VB.Label Label11
Caption = "备 注:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 18
Top = 3240
Width = 975
End
Begin VB.Label Label6
Caption = "评 价:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 7
Top = 2640
Width = 975
End
Begin VB.Label Label5
Caption = "维修人员:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 6
Top = 2160
Width = 1095
End
Begin VB.Label Label4
Caption = "维修时间:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 5
Top = 360
Width = 1095
End
End
Begin VB.Frame Frame1
Caption = "报修情况"
BeginProperty Font
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2535
Left = 360
TabIndex = 0
Top = 120
Width = 6015
Begin VB.TextBox Text8
Height = 390
Left = 1680
TabIndex = 17
Top = 1920
Width = 3735
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1680
TabIndex = 15
Top = 240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "确 定"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3840
TabIndex = 13
Top = 480
Width = 1215
End
Begin VB.TextBox Text3
Height = 375
Left = 1680
TabIndex = 9
Top = 1320
Width = 3735
End
Begin VB.TextBox Text2
Height = 375
Left = 1680
TabIndex = 8
Top = 720
Width = 1455
End
Begin VB.Label Label10
Caption = "备注:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 16
Top = 1920
Width = 1095
End
Begin VB.Label Label3
Caption = "报修内容:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 4
Top = 1440
Width = 1095
End
Begin VB.Label Label2
Caption = "报修时间:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 3
Top = 840
Width = 1095
End
Begin VB.Label Label1
Caption = "宿 舍:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 2
Top = 360
Width = 855
End
End
End
Attribute VB_Name = "frmmend"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim con As ADODB.Connection
Private Sub Command1_Click()
Dim myrs As New ADODB.Recordset
myrs.Open "SELECT * FROM 报修", con, adOpenDynamic, adLockOptimistic, adCmdText
myrs.AddNew
If Combo2.Text = "" Then
MsgBox "报修的宿舍不能为空!"
Exit Sub
Combo2.SetFocus
End If
If Text2.Text = "" Then
MsgBox "报修时间不能为空!"
Exit Sub
Text2.SetFocus
End If
If Text3.Text = "" Then
MsgBox "报修内容不能为空!"
Exit Sub
Text3.SetFocus
End If
myrs.Fields(0) = Combo2.Text
myrs.Fields(1) = Text2.Text
myrs.Fields(2) = Text3.Text
myrs.Update
MsgBox "报修成功!"
End Sub
Private Sub Command2_Click()
Dim myrs As New ADODB.Recordset
myrs.Open "SELECT * FROM 维修", con, adOpenDynamic, adLockOptimistic, adCmdText
myrs.AddNew
If Combo1.Text = "" Then
MsgBox "宿舍号不能为空!"
Exit Sub
Combo1.SetFocus
End If
If Text1.Text = "" Then
MsgBox "维修内容不能为空!"
Exit Sub
Text1.SetFocus
End If
If Text4.Text = "" Then
MsgBox "维修时间不能为空!"
Exit Sub
Text4.SetFocus
End If
If Text5.Text = "" Then
MsgBox "维修人员不能为空!"
Exit Sub
Text5.SetFocus
End If
If Text6.Text = "" Then
MsgBox "评价不能为空!"
Exit Sub
Text6.SetFocus
End If
myrs.Fields(0) = Text4.Text
myrs.Fields(1) = Combo1.Text
myrs.Fields(2) = Text1.Text
myrs.Fields(3) = Text5.Text
myrs.Fields(4) = Text6.Text
myrs.Fields(5) = Text9.Text
myrs.Update
MsgBox "报修的问题已解决!"
End Sub
Private Sub Form_Load()
Set con = New ADODB.Connection
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\数据.mdb;Persist Security Info=False"
con.CursorLocation = adUseClient
con.Open
Dim myrs1 As New ADODB.Recordset
Dim myrs2 As New ADODB.Recordset
myrs1.Open "select * from 报修", con, adOpenForwardOnly, adLockReadOnly
myrs2.Open "select * from 维修", con, adOpenForwardOnly, adLockReadOnly
Dim ss As New ADODB.Recordset
Dim aa As New ADODB.Recordset
Dim query0 As String
Dim query2 As String
Dim i As Integer
query0 = "select * from 电量"
ss.Open query0, con, 3, 3
If ss.RecordCount > 0 Then
For i = 1 To ss.RecordCount
Combo2.AddItem ss.Fields(0)
ss.MoveNext
Next
End If
query2 = "select * from 报修"
aa.Open query2, con, 3, 3
If aa.RecordCount > 0 Then
For i = 1 To aa.RecordCount
Combo1.AddItem aa.Fields(0)
aa.MoveNext
Next
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -