急求VB代码翻译!

谁能帮我翻译下啊!!!!PrivateSubCombo1_Change(IndexAsInteger)Text1(Index).Text=Combo1(Index).Te... 谁能帮我翻译下啊!!!!

Private Sub Combo1_Change(Index As Integer)
Text1(Index).Text = Combo1(Index).Text
End Sub

Private Sub Combo1_Click(Index As Integer)
Text1(Index).Text = Combo1(Index).Text
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command6_Click() ''保存
If Trim(Text1(0).Text) = "" Then Exit Sub
On Error GoTo err
CN.Execute "delete from 学生信息表 where 学号='" & Trim(Text1(0).Text) & "'"
Dim rst As New ADODB.Recordset
If rst.State Then rst.Close
rst.Open "select * from 学生信息表", CN, adOpenStatic, adLockOptimistic
rst.AddNew
Dim i As Integer
For i = 1 To 5
If Trim(Text1(i - 1).Text) <> "" Then
rst.Fields(i).Value = Trim(Text1(i - 1).Text)
End If
Next i
rst.Fields(i).Value = Format(Now, "yyyy-MM-dd hh:ss:mm")
rst.Update
MsgBox "保存成功!", , "提示"
Unload Me
Exit Sub
err:
MsgBox err.Description, , "提示"
End Sub

Private Sub Form_Load()
'On Error GoTo err
Dim rst As New ADODB.Recordset

If isAdd = True Then
For i = 0 To 4
Text1(i).Text = ""
Next
Text1(0).Locked = False

Else
If rst.State Then rst.Close
rst.Open "select * from 学生信息表 where 编号=" & Trim(strLook), CN, adOpenStatic, adLockOptimistic
If Not rst.EOF Then
For i = 1 To 5
If Not IsNull(rst.Fields(i)) Then
Text1(i - 1).Text = Trim(rst.Fields(i))
End If
Next i
End If
End If

Exit Sub
err:
MsgBox err.Description, , "提示"
End Sub

Private Sub Text1_LostFocus(Index As Integer)
If Trim(Text1(0).Text) = "" Then Exit Sub
If Len(Text1(0).Text) <> 11 Then
MsgBox "学号是11位!", , "提示"
Text1(0).Text = ""
Exit Sub
End If
End Sub
展开
 我来答
书西靠可暴2h
2010-05-30 · TA获得超过487个赞
知道小有建树答主
回答量:367
采纳率:0%
帮助的人:215万
展开全部
Private Sub Combo1_Change(Index As Integer)
Text1(Index).Text = Combo1(Index).Text 'text1(所有组)文本值='combo1(所有组)文本值

End Sub

Private Sub Combo1_Click(Index As Integer)
Text1(Index).Text = Combo1(Index).Text
End Sub

Private Sub Command2_Click()
Unload Me '退出
End Sub

Private Sub Command6_Click() ''保存
If Trim(Text1(0).Text) = "" Then Exit Sub '如果text1(0)去掉2端空格之后的值为空 则退出本过程

On Error GoTo err '遇到错误跳转到err
CN.Execute "delete from 学生信息表 where 学号='" & Trim(Text1(0).Text) & "'" '赋值
Dim rst As New ADODB.Recordset
If rst.State Then rst.Close
rst.Open "select * from 学生信息表", CN, adOpenStatic, adLockOptimistic
rst.AddNew '增加新list
Dim i As Integer
For i = 1 To 5 '循环开始
If Trim(Text1(i - 1).Text) <> "" Then '如果text(i-1)的去空格值为空

rst.Fields(i).Value = Trim(Text1(i - 1).Text)
End If
Next i
rst.Fields(i).Value = Format(Now, "yyyy-MM-dd hh:ss:mm") 'rst值格式为yyyy-MM-dd hh:ss:mm

rst.Update
MsgBox "保存成功!", , "提示"
Unload Me
Exit Sub

err: '错误事件
MsgBox err.Description, , "提示" '弹出错误描述
End Sub

Private Sub Form_Load()
'On Error GoTo err
Dim rst As New ADODB.Recordset '定义新纪录

If isAdd = True Then
For i = 0 To 4
Text1(i).Text = ""
Next
Text1(0).Locked = False 'text1(0)不允许编辑

Else
If rst.State Then rst.Close 'rst关闭
rst.Open "select * from 学生信息表 where 编号=" & Trim(strLook), CN, adOpenStatic, adLockOptimistic '赋值
If Not rst.EOF Then '如果没有发生错误
For i = 1 To 5
If Not IsNull(rst.Fields(i)) Then '如果不是空值
Text1(i - 1).Text = Trim(rst.Fields(i))
End If
Next i
End If
End If

Exit Sub
err:
MsgBox err.Description, , "提示"
End Sub

Private Sub Text1_LostFocus(Index As Integer)
If Trim(Text1(0).Text) = "" Then Exit Sub
If Len(Text1(0).Text) <> 11 Then
MsgBox "学号是11位!", , "提示"
Text1(0).Text = ""
Exit Sub
End If
End Sub
希奕际
2024-04-10 广告
剑桥文理与剑桥艺术学校中国 基于剑桥文理学校优质的海外校本部资源和课程方向,现开设四类课程:艺术与设计课程、音乐与戏剧课程、英国A-Level课程、波士顿文理中学美高与AP课程。荣获2021胡润百学中国国际学校艺术类领军学校奖,2022胡润... 点击进入详情页
本回答由希奕际提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式