求教:大神看看是哪里出错了 Private Sub Command1_Click()If Trim(txtName.Text) = "" ThenMsgBox "请输入单位名称"txtName.SetFocusExit SubEnd IfAdodc1.Recordset.AddNewAdodc1.Recordset.Fields("name") = txtName.TextAdodc1.Recordset.Field

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 15:26:10
求教:大神看看是哪里出错了PrivateSubCommand1_Click()IfTrim(txtName.Text)=""ThenMsgBox"请输入单位名称"txtName.SetFocusExi

求教:大神看看是哪里出错了 Private Sub Command1_Click()If Trim(txtName.Text) = "" ThenMsgBox "请输入单位名称"txtName.SetFocusExit SubEnd IfAdodc1.Recordset.AddNewAdodc1.Recordset.Fields("name") = txtName.TextAdodc1.Recordset.Field
求教:大神看看是哪里出错了
Private Sub Command1_Click()
If Trim(txtName.Text) = "" Then
MsgBox "请输入单位名称"
txtName.SetFocus
Exit Sub
End If
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("name") = txtName.Text
Adodc1.Recordset.Fields("district") = txtdistrict.Text
Adodc1.Recordset.Fields("category") = txtcategory.Text
Adodc1.Recordset.Fields("delegate") = txtdelegate.Text
Adodc1.Recordset.Fields("way") = txtway.Text
Adodc1.Recordset.Update
Unload Me
End Sub

求教:大神看看是哪里出错了 Private Sub Command1_Click()If Trim(txtName.Text) = "" ThenMsgBox "请输入单位名称"txtName.SetFocusExit SubEnd IfAdodc1.Recordset.AddNewAdodc1.Recordset.Fields("name") = txtName.TextAdodc1.Recordset.Field
括号里是数据库中的属性,此程序是实现点击添加数据记录的.单从这个私有sub看不出哪里出错.