📄 form2.frm
字号:
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2040
TabIndex = 26
Top = 6360
Width = 615
End
Begin VB.Label Label20
BackColor = &H00FFFFFF&
Caption = "添加年份"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4560
TabIndex = 25
Top = 5040
Width = 1095
End
Begin VB.Label Label21
Alignment = 2 'Center
Caption = "借用单编号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 24
Top = 600
Width = 1575
End
End
Begin MSAdodcLib.Adodc Adodc3
Height = 375
Left = 12240
Top = 9000
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 661
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 = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc3"
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 MSAdodcLib.Adodc Adodc2
Height = 495
Left = 1440
Top = 9240
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
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 MSComctlLib.ImageList ImageList1
Left = 960
Top = 8280
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
MaskColor = 12632256
_Version = 393216
End
Begin MSAdodcLib.Adodc Adodc4
Height = 495
Left = 1200
Top = 5280
Visible = 0 'False
Width = 2655
_ExtentX = 4683
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc2"
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 = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Function shuzi(wenbenkuang As TextBox, KeyAscii As Integer)
If KeyAscii = Asc(".") Or KeyAscii = Asc("1") Or KeyAscii = Asc("2") Or KeyAscii = Asc("3") Or KeyAscii = Asc("4") Or KeyAscii = Asc("5") Or KeyAscii = Asc("6") Or KeyAscii = Asc("7") Or KeyAscii = Asc("8") Or KeyAscii = Asc("9") Or KeyAscii = Asc("0") Or KeyAscii = 8 Then
Else
KeyAscii = 0
End If
If Mid(wenbenkuang.Text, 1, 1) = "0" And Mid(wenbenkuang.Text, 2, 1) <> "." Then
wenbenkuang.Text = ""
MsgBox "填写数字有误!"
End If
If Mid(wenbenkuang.Text, 1, 1) = "." Then
wenbenkuang.Text = ""
End If
Dim i, t As Integer
t = 0 't为标志量判断小数点的个数
If Len(wenbenkuang.Text) >= 2 Then
For i = 1 To Len(wenbenkuang.Text) - 1
If Mid(wenbenkuang.Text, i, 1) = "." Then
t = t + 1
End If
Next i
If t >= 2 Then
wenbenkuang.Text = ""
MsgBox "填写数字有误!"
End If
End If
End Function
Public Function xiaoshudian(shu As Single)
Dim s As String
If shu - Int(shu) = 0 Then
For i = 1 To 2
s = s + "0"
Next i
s = CStr(Int(shu)) + "." + s
shu = Val(s)
End If
End Function
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text14.Enabled = True
Command6.Enabled = True
End If
If Check1.Value = 0 Then
Text14.Enabled = 0
Command6.Enabled = False
End If
End Sub
Private Sub Combo1_Change()
If wuzi_newdan_flag = True Then '//如果开新单才能使标示新单有效
Adodc2.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select max(mid(单据号,5,4)) as jine from wuzi where mid(单据号,1,4)='" & Combo1.Text & "'"
Adodc2.Refresh
If Not IsNull(Adodc2.Recordset("jine").Value) Then
s = CStr(Val(Adodc2.Recordset("jine").Value) + 1)
For i = 0 To 3 - Len(s)
t = t + "0"
Next i
s = t + s
Label8.Caption = "(" + Combo1.Text + ")" + "第" + s + "号"
wuzi_str_biaodan = Combo1.Text + s
Else
Label8.Caption = "(" + Combo1.Text + ")" + "第" + "0001" + "号"
wuzi_str_biaodan = Combo1.Text + "0001"
End If
End If
End Sub
Private Sub Combo1_Click()
If wuzi_newdan_flag = True Then '//如果开新单才能使标示新单有效
Adodc2.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
Adodc2.CommandType = adCmdText
Adodc2.RecordSource = "select max(mid(单据号,5,4)) as jine from wuzi where mid(单据号,1,4)='" & Combo1.Text & "'"
Adodc2.Refresh
If Not IsNull(Adodc2.Recordset("jine").Value) Then
s = CStr(Val(Adodc2.Recordset("jine").Value) + 1)
For i = 0 To 3 - Len(s)
t = t + "0"
Next i
s = t + s
Label8.Caption = "(" + Combo1.Text + ")" + "第" + s + "号"
wuzi_str_biaodan = Combo1.Text + s
Else
Label8.Caption = "(" + Combo1.Text + ")" + "第" + "0001" + "号"
wuzi_str_biaodan = Combo1.Text + "0001"
End If
End If
End Sub
Private Sub Command1_Click()
If Adodc1.Recordset.RecordCount >= 5 Then
MsgBox "每张验收单至多开5条记录,请开新单!"
Exit Sub
End If
jyrdw.Enabled = True
jyr.Enabled = True
bmzg.Enabled = True
jbr.Enabled = True
zd.Enabled = True
zcbh.Enabled = True
flh.Enabled = True
mc.Enabled = True
ggxh.Enabled = True
dw.Enabled = True
syzt.Enabled = True
syfx.Enabled = True
bz.Enabled = True
Command1.Enabled = False
Combo1.Enabled = False '组合框禁用
List1.Enabled = False
Command7.Enabled = True '保存功能开启
Command8.Enabled = True '返回功能开启
Command2.Enabled = False '删除功能屏蔽
Command3.Enabled = False '打印功能屏蔽
Command5.Enabled = False '入库功能屏蔽
DataGrid1.Enabled = False '表格功能屏蔽
If jyrdw.Text <> "" Then
zcbh.SetFocus
Else
jyrdw.SetFocus
End If
End Sub
Private Sub Command2_Click()
On Error GoTo err:
If Adodc1.Recordset.EOF And Adodc1.Recordset.BOF Then
Exit Sub
End If
ffff = MsgBox("确实要删除吗?", vbYesNo)
If ffff = vbYes Then
Adodc1.Recordset.Delete
End If
Adodc1.Recordset.Requery
'*********************************************
'左边验收单显示刷新
Adodc3.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
Adodc3.CommandType = adCmdText
Adodc3.RecordSource = "select distinct(单据号) as 验收单 from wuzi order by 单据号 desc"
Adodc3.Refresh
Adodc3.Recordset.Requery
If Adodc3.Recordset.EOF And Adodc3.Recordset.BOF Then
Else
List1.Clear '先将list 控件内容清空
Adodc3.Recordset.MoveFirst
Do Until Adodc3.Recordset.EOF
List1.AddItem Adodc3.Recordset.Fields("验收单").Value
Adodc3.Recordset.MoveNext
Loop
End If
Exit Sub
err:
End Sub
Private Sub Command3_Click()
Dim PageDirection As Integer
PageDirection = 0
Call SetOrientation(DMDUP_SIMPLEX, PageDirection)
If Adodc1.Recordset.RecordCount < 1 Then
Exit Sub
End If
'打印前首先统计总和避免出错
'**************************************************************************
ReDim wuzi_arr_zcbh(5)
ReDim wuzi_arr_mc(5)
ReDim wuzi_arr_ggxh(5)
ReDim wuzi_arr_dw(5)
ReDim wuzi_arr_syfx(5)
ReDim wuzi_arr_syzt(5)
ReDim wuzi_arr_flh(5)
ReDim wuzi_arr_bz(5)
ReDim wuzi_arr_zd(5)
If Adodc1.Recordset.EOF And Adodc1.Recordset.BOF Then
Exit Sub
End If
Adodc1.Recordset.MoveFirst
If Not IsNull(Adodc1.Recordset("借用人单位").Value) Then
ActiveReport2.jyrdw1.Caption = Adodc1.Recordset("借用人单位").Value
End If
If Not IsNull(Adodc1.Recordset("借用人").Value) Then
ActiveReport2.jyr1.Caption = Adodc1.Recordset("借用人").Value
End If
If Not IsNull(Adodc1.Recordset("单据号").Value) Then
ActiveReport2.Label6.Caption = Adodc1.Recordset("单据号").Value
End If
If Not IsNull(Adodc1.Recordset("部门主管").Value) Then
ActiveReport2.bmzg1.Caption = Adodc1.Recordset("部门主管").Value
End If
If Not IsNull(Adodc1.Recordset("制单").Value) Then
ActiveReport2.zd1.Caption = Adodc1.Recordset("制单").Value
End If
For i = 0 To Adodc1.Recordset.RecordCount - 1
If Not IsNull(Adodc1.Recordset("资产编号").Value) Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -