📄 form26.frm
字号:
VERSION 5.00
Begin VB.Form Form26
BorderStyle = 3 'Fixed Dialog
Caption = "Form26"
ClientHeight = 6090
ClientLeft = 45
ClientTop = 330
ClientWidth = 7170
LinkTopic = "Form26"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6090
ScaleWidth = 7170
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text7
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 8
Text = "0"
Top = 4800
Width = 1770
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 7
Text = "0"
Top = 4200
Width = 1770
End
Begin VB.TextBox Text6
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 6
Top = 3600
Width = 1770
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 = 2760
TabIndex = 9
Top = 5400
Width = 1575
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 5
Top = 3000
Width = 1770
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 3120
TabIndex = 4
Top = 2520
Width = 1770
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 3
Top = 1920
Width = 1770
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 2
Top = 1320
Width = 1770
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 440
Left = 3120
TabIndex = 1
Top = 720
Width = 1770
End
Begin VB.Label Label9
AutoSize = -1 'True
Caption = "少收金额:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1920
TabIndex = 17
Top = 4920
Width = 1200
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "欠款金额:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1920
TabIndex = 16
Top = 4320
Width = 1200
End
Begin VB.Label Label8
AutoSize = -1 'True
Caption = "帐面金额:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 1920
TabIndex = 15
Top = 3720
Width = 1200
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "售出帐单明细输入画面"
BeginProperty Font
Name = "黑体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 2040
TabIndex = 14
Top = 240
Width = 3150
End
Begin VB.Label Label6
Caption = "帐单号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 13
Top = 3120
Width = 975
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "帐本号:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2160
TabIndex = 12
Top = 2520
Width = 960
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "日 期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2160
TabIndex = 11
Top = 2040
Width = 960
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "月 份:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2160
TabIndex = 10
Top = 1440
Width = 960
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "年 份:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 2160
TabIndex = 0
Top = 840
Width = 960
End
End
Attribute VB_Name = "Form26"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim f_max_number, f_formshow
Private Sub Command1_Click()
If Text3.Text = "" Then
MsgBox ("日期没有输入!")
Text3.SetFocus
GoSub exit_Command1_Click
End If
If Text4.Text = "" Then
MsgBox ("金额没有输入!")
Text4.SetFocus
GoSub exit_Command1_Click
End If
If Combo1.Text = "" Then
MsgBox ("帐本号没有输入!")
Combo1.SetFocus
GoSub exit_Command1_Click
End If
If Text5.Text = "" Then
MsgBox ("帐单号没有输入!")
Text5.SetFocus
GoSub exit_Command1_Click
End If
If Text6.Text = "" Then
MsgBox ("金额错!")
Text6.SetFocus
GoSub exit_Command1_Click
End If
Dim cnn1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim rs1 As ADODB.Recordset
'Set rs1 = New adodb.Recordset
Set cnn1 = New ADODB.Connection
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Documents and Settings\jujumao\My Documents\粤丰饲料\粤丰饲料经营情况.mdb;"
Set cmd1 = New ADODB.Command
SQL = "Select count(*) from 帐单表 where 帐本号= " & "'" & Combo1.Text & "'" & " and 帐单号 = " & "'" & Text5.Text & "'"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
End With
Set rs1 = cmd1.Execute
rs1.MoveFirst
If rs1.Fields(0) > 0 Then
MsgBox ("该帐单号已经输入!")
Text5.SetFocus
GoSub exit_Command1_Click
End If
SQL = "SELECT count(*),MAX(编号) from 帐单表"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
End With
Set rs1 = cmd1.Execute
rs1.MoveFirst
If rs1.Fields(0) = 0 Then
f_max_number = 0
Else
f_max_number = rs1.Fields(1) + 1
End If
t_repay = 0
SQL = "INSERT INTO 帐单表(编号,年份,月份,日期,帐本号,帐单号,金额,欠款金额,还款金额,少收金额) " & _
" VALUES ( " & f_max_number & "," & Text1.Text & "," & Text2.Text & "," & Text3.Text & _
"," & "'" & Combo1.Text & "'" & "," & "'" & Text5.Text & "'" & "," & Text6.Text & "," & Text4.Text & "," & _
t_repay & "," & Text7.Text & ")"
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
.Execute
End With
cnn1.Close
Set cnn1 = Nothing
MsgBox ("数据保存成功")
g_book = Combo1.Text
g_reckoning = Text5.Text
g_year = Text1.Text
f_formshow = "NO"
g_form = "form26"
Form42.Show
Unload Form26
exit_Command1_Click:
End Sub
Private Sub Form_Load()
f_formshow = "OK"
Dim cnn1 As ADODB.Connection
Dim cmd1 As ADODB.Command
Dim rs As ADODB.Recordset
Set cnn1 = New ADODB.Connection
Set rs = New ADODB.Recordset
cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jujumao\My Documents\粤丰饲料\粤丰饲料经营情况.mdb;Persist Security Info=False"
Set cmd1 = New ADODB.Command
SQL = "select 帐本号 from 帐本表 where 使用年份=" & g_year
With cmd1
.ActiveConnection = cnn1
.CommandText = SQL
.CommandType = adCmdText
End With
Set rs1 = cmd1.Execute
rs1.MoveFirst
i = 0
While Not rs1.EOF
Combo1.AddItem rs1.Fields(0), i
rs1.MoveNext
i = i + 1
Wend
cnn1.Close
Set cnn1 = Nothing
Text1.Text = g_year
Text2.Text = g_month
End Sub
Private Sub Form_Unload(Cancel As Integer)
If f_formshow = "OK" Then
Form2.Show
End If
End Sub
Private Sub Text1_GotFocus()
Text3.SetFocus
End Sub
Private Sub Text2_GotFocus()
Text3.SetFocus
End Sub
Private Sub Text6_LostFocus()
Text7.Text = Round(Text6.Text - Int(Text6.Text), 2)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -