rs.Close
End If
rs.Open str1, cn, 1, 3
If rs.EOF Then
MsgBox "不存在该设备"
Else
Text1.Text = rs("编号")
Text2.Text = rs("设备名称")
Text3.Text = rs("设备编号")
Text4.Text = rs("领用者")
Text5.Text = rs("领用数量")
Text6.Text = rs("领用部门")
Text7.Text = rs("领用日期")
End If
End Sub
Private Sub Command2_Click()
主界面.Show
cn.Close
Unload Me
End Sub
消耗查询:
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Private Sub Form_Load()
If cn.State = 1 Then
cn.Close
End If
cn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\设备管理系统.mdb;" & "Persist Security Info=False"
cn.Open
End Sub
Private Sub command1_Click()
str1 = "select * from 设备消耗登记表 where 编号='" & Text1.Text & "'"
If rs.State = 1 Then
rs.Close
End If
rs.Open str1, cn, 1, 3
If rs.EOF Then
MsgBox "该设备不存在"
Else
Text1.Text = rs("编号")
Text2.Text = rs("设备名称")
Text3.Text = rs("设备编号")
Text4.Text = rs("设备数量")
Text5.Text = rs("登记人")
Text6.Text = rs("使用部门")
Text7.Text = rs("报废日期")
Text8.Text = rs("报废原因")
End If
End Sub
Private Sub Command2_Click()
主界面.Show
cn.Close
Unload Me
End Sub
基本信息报表:
Private Sub Command1_Click()
DataReport1.Show
DataReport1.LeftMargin = 0
DataReport1.RightMargin = 0
DataReport1.TopMargin = 0
DataReport1.BottomMargin = 0
DataReport1.ReportWidth = 纸张宽度 * 56.7
End Sub
Private Sub Command2_Click()
主界面.Show
Unload Me
End Sub
领用报表:
Private Sub Command1_Click()
DataReport2.Show
DataReport2.LeftMargin = 0
DataReport2.RightMargin = 0
DataReport2.TopMargin = 0
DataReport2.BottomMargin = 0
DataReport2.ReportWidth = 纸张宽度 * 56.7
End Sub
Private Sub Command2_Click()
主界面.Show
Unload Me
End Sub
消耗报表:
Private Sub Command1_Click()
DataReport3.Show VB设备管理系统设计+需求分析+可行性分析(23):http://www.751com.cn/jisuanji/lunwen_192.html