求助高手,代码注释
哪位高人能帮我把下面一段代码写下中文注释啊。。。小弟痛哭流泪不胜感激。。Private Sub Command1_Click()
If Command1.Tag = "True" Then
If Command1.Caption = "输入新记录" Then
r = 1
If A1.Recordset.BOF = True And A1.Recordset.EOF = True Then
Else
A1.Recordset.MoveFirst
End If
For X = 1 To 1
If A1.Recordset.EOF = True Then
A1.Tag = Y
Exit For
Else
A1.Recordset.MoveNext
End If
X = X - 1
r = r + 1
Next X
A1.Recordset.AddNew
Label3.Caption = r
Command1.Caption = "输入完毕"
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Form3.Height = 8220
Form3.Top = 300
F1.Visible = True
Else
If t3(0).Text = "" Then
MsgBox "固定资产不能为空!", 16, "出错:"
t3(0).Text = "123"
A1.Recordset.Delete
Command1.Caption = "输入新记录"
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Form3.Height = 5728
Form3.Left = 600
Form3.Top = 1500
F1.Visible = False
Else
For X = 11 To 13
If Len(Trim(t3(X).Text)) > 200 Then
MsgBox "字符不能超过200个!", 16, "出错:"
Exit Sub
End If
Next X
A1.Recordset.MovePrevious
A1.Recordset.MoveNext
Command1.Caption = "输入新记录"
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Form3.Height = 5728
F1.Visible = False
Form3.Left = 600
Form3.Top = 1500
End If
End If
Else
MsgBox "您没有这个权限!", 16, "出错:"
End If
End Sub
Private Sub Command10_Click()
For X = 0 To 6
If A1.Recordset.EOF = True Then
MsgBox "您已经位于最后一条记录", 32, "提示:"
A1.Recordset.MovePrevious
Exit Sub
Else
A1.Recordset.MoveNext
End If
Next X
End Sub
Private Sub Command11_Click()
Form10.Show
Unload Me
End Sub
Private Sub Command2_Click()
If Command2.Tag = "True" Then
If A1.Recordset.EOF = True And A1.Recordset.BOF = True Then
MsgBox "您的数据库中没有记录!", 16, "出错:"
Else
If Command2.Caption = "查询" Then
Command8.Caption = "显示信息"
Form3.Top = 700
Form3.Height = 5670
Command2.Caption = "结束查询"
F3.Visible = True
Command1.Enabled = False
Command4.Enabled = False
Command3.Enabled = False
Else
A1.Recordset.MoveFirst
Command2.Caption = "查询"
Command8.Caption = "打印"
Form3.Top = 1500
Form3.Height = 5728
Form3.Left = 600
Command1.Enabled = True
Command4.Enabled = True
Command3.Enabled = True
F3.Visible = False
End If
End If
Else
MsgBox "您没有这个权限!", 16, "出错:"
End If
End Sub
Private Sub Command3_Click()
If Command1.Tag = "True" Then
If A1.Recordset.EOF = True And A1.Recordset.BOF = True Then
MsgBox "您的数据库中没有记录!", 16, "出错:"
Else
If Command3.Caption = "修改记录" Then
Command3.Caption = "修改完毕"
Command2.Enabled = False
Command1.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Form3.Height = 8220
Form3.Top = 300
F1.Visible = True
F1.Caption = "修改记录:"
Else
If t3(0).Text = "" Then
MsgBox "固定资产不能为空!", 16, "出错:"
Else
For X = 11 To 13
If Len(Trim(t3(X).Text)) > 200 Then
MsgBox "字符不能超过200个!", 16, "出错:"
Exit Sub
End If
Next X
Command3.Caption = "修改记录"
Command2.Enabled = True
Command1.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
Form3.Height = 5728
Form3.Left = 600
Form3.Top = 1500
F1.Visible = False
F1.Caption = "数据输入:"
End If
End If
End If
Else
MsgBox "您没有这个权限!", 16, "出错:"
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Command5_Click()
If Command1.Tag = "True" Then
If A1.Recordset.EOF = True Or A1.Recordset.BOF = True Then
MsgBox "您的数据库中没有记录可以删除!", 16, "出错:"
Else
A1.Recordset.Delete
Y = 1
A1.Recordset.MoveFirst
For X = 1 To 1
If A1.Recordset.EOF = True Then
If A1.Recordset.BOF = True Then
Else
A1.Recordset.MoveFirst
End If
Exit For
Else
Label3.Caption = Y
A1.Recordset.MoveNext
Y = Y + 1
X = X - 1
End If
Next X
End If
Else
MsgBox "您没有这个权限!", 16, "出错:"
End If
End Sub
Private Sub Command6_Click()
For X = 0 To 7
If t17(X).Text = "" Then
Else
Command6.Tag = t17(X).Text
Command7.Tag = X
A1.Recordset.MoveFirst
Call cx
Exit Sub
End If
Next X
MsgBox "您没有输入要查询的值!", 16, "出错:"
End Sub
Sub cx()
For X = 1 To 1
If Trim(Command6.Tag) = Trim(t3(Val(Command7.Tag)).Text) Then
Exit Sub
Else
If A1.Recordset.EOF = True Then
Else
A1.Recordset.MoveNext
End If
If A1.Recordset.EOF = True Then
MsgBox "没有找你到要查询的记录!", 32, "提示:"
Exit Sub
Else
X = X - 1
End If
End If
Next X
End Sub
Private Sub Command7_Click()
For X = 0 To 7
If t17(X).Text = "" Then
Else
Command6.Tag = t17(X).Text
Command7.Tag = X
If A1.Recordset.EOF = True Then
Else
A1.Recordset.MoveNext
End If
Call cx
Exit Sub
End If
Next X
MsgBox "您没有输入要查询的值!", 16, "出错:"
End Sub
Private Sub Command8_Click()
Form4.Show
End Sub
Private Sub Command9_Click()
For X = 0 To 6
If A1.Recordset.BOF = True Then
MsgBox "您已经位于第一条记录", 32, "提示:"
A1.Recordset.MoveNext
Exit Sub
Else
A1.Recordset.MovePrevious
End If
Next X
End Sub
Private Sub F3_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Command4.Enabled = True Then
Cancel = 0
Else
MsgBox "请编辑完这条记录再退出!", 64, "提示:"
Cancel = 1
End If
End Sub
―――-固定资产查询源代码:
Private Sub Command2_Click()
If A1.Recordset.EOF = True And A1.Recordset.BOF = True Then
MsgBox "您的数据库中没有记录!", 16, "出错:"
Else
If Command2.Caption = "查询" Then
Command8.Caption = "显示信息"
Form3.Top = 700
Form3.Height = 5670
Command2.Caption = "结束查询"
F3.Visible = True
Command4.Enabled = False
Else
A1.Recordset.MoveFirst
Command2.Caption = "查询"
Command8.Caption = "打印"
Form3.Top = 1500
Form3.Height = 5728
Form3.Left = 600
Command4.Enabled = True
F3.Visible = False
End If
End If
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Sub cx()
For X = 1 To 1
If Trim(Command6.Tag) = Trim(t3(Val(Command7.Tag)).Text) Then
Exit Sub
Else
If A1.Recordset.EOF = True Then
Else
A1.Recordset.MoveNext
End If
If A1.Recordset.EOF = True Then
MsgBox "没有找你到要查询的记录!", 32, "提示:"
Exit Sub
Else
X = X - 1
End If
End If
Next X
End Sub
Private Sub Command6_Click()
For X = 0 To 7
If t17(X).Text = "" Then
Else
Command6.Tag = t17(X).Text
Command7.Tag = X
A1.Recordset.MoveFirst
Call cx
Exit Sub
End If
Next X
MsgBox "您没有输入要查询的值!", 16, "出错:"
End Sub
Private Sub Command8_Click()
Form4.Show
End Sub
Private Sub Command9_Click()
For X = 0 To 6
If A1.Recordset.BOF = True Then
MsgBox "您已经位于第一条记录", 32, "提示:"
A1.Recordset.MoveNext
Exit Sub
Else
A1.Recordset.MovePrevious
End If
Next X
End Sub
Private Sub D1_Click()
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Command4.Enabled = True Then
Cancel = 0
Else
MsgBox "请编辑完这条记录再退出!", 64, "提示:"
Cancel = 1
End If
End Sub