VB错误至少一个参数没有被指定值 5
PrivateSubCmdAdd_Click()'添加记录Adodc1.Recordset.AddNewFori=0To4Text(i).Enabled=tureText...
Private Sub CmdAdd_Click() '添加记录
Adodc1.Recordset.AddNew
For i = 0 To 4
Text(i).Enabled = ture
Text(i).Text = ""
Next
Text1(0).SetFocus
CmdAdd.Enabled = False
CmdDelete.Enabled = False
CmdModify.Enabled = False
CmdSave.Enabled = True
End Sub
Private Sub CmdDelete_Click() '删除记录
Dim myval As String
myval = MsgBox("是否要删除该记录", vbYesNo)
If myval = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveLast
For i = 0 To 4
Text1(i).Enabled = False
Next i
End If
End Sub
Private Sub CmdExit_Click()
Unload Me
End Sub
Private Sub CmdModify_Click() '修改记录
If Adodc1.Recordset.RecordCount <> 0 Then
For i = 0 To 4
Text1(i).Enabled = True
Next i
CmdAdd.Enabled = False
CmdDelete.Enabled = False
CmdModify.Enabled = False
CmdSave.Enabled = True
Else
MsgBox ("没有要修改的数据")
End If
End Sub
Private Sub CmdSave_Click() '更新记录
Adodc1.Recordset.Update '设置控件不可用
For i = 0 To 4
Text1(i).Enabled = False
Next i
CmdAdd.Enabled = True
CmdDelete.Enabled = True
CmdModify.Enabled = True
CmdSave.Enabled = False
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\Users\Administrator\Desktop\sjk\cdjxx.mdb"
'查询所有记录,并按编号排序
Adodc1.RecordSource = "select * from 充电架信息表 order by 充电架信息"
Adodc1.Refresh
For i = 0 To 4
Text1(i).Enabled = False
Next i
CmdSave.Enabled = False
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
Select Case Index
Case Is = Index
If KeyCode = vbKeyReturn And Index < 4 Then Text1(Index + 1).SetFocus '回车获得焦点
If KeyCode = vbKeyReturn And Index = 4 Then CmdSave.SetFocus
If KeyCode = vbKeyUp And Index > 1 Then Text1(Index - 1).SetFocus
End Select
End Sub
出现错误调试时Adodc1.RecordSource = "select * from 充电架信息表 order by 充电架信息"
Adodc1.Refresh
有问题,不知道怎么改,求高手赐教,谢谢!! 展开
Adodc1.Recordset.AddNew
For i = 0 To 4
Text(i).Enabled = ture
Text(i).Text = ""
Next
Text1(0).SetFocus
CmdAdd.Enabled = False
CmdDelete.Enabled = False
CmdModify.Enabled = False
CmdSave.Enabled = True
End Sub
Private Sub CmdDelete_Click() '删除记录
Dim myval As String
myval = MsgBox("是否要删除该记录", vbYesNo)
If myval = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveLast
For i = 0 To 4
Text1(i).Enabled = False
Next i
End If
End Sub
Private Sub CmdExit_Click()
Unload Me
End Sub
Private Sub CmdModify_Click() '修改记录
If Adodc1.Recordset.RecordCount <> 0 Then
For i = 0 To 4
Text1(i).Enabled = True
Next i
CmdAdd.Enabled = False
CmdDelete.Enabled = False
CmdModify.Enabled = False
CmdSave.Enabled = True
Else
MsgBox ("没有要修改的数据")
End If
End Sub
Private Sub CmdSave_Click() '更新记录
Adodc1.Recordset.Update '设置控件不可用
For i = 0 To 4
Text1(i).Enabled = False
Next i
CmdAdd.Enabled = True
CmdDelete.Enabled = True
CmdModify.Enabled = True
CmdSave.Enabled = False
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:\Users\Administrator\Desktop\sjk\cdjxx.mdb"
'查询所有记录,并按编号排序
Adodc1.RecordSource = "select * from 充电架信息表 order by 充电架信息"
Adodc1.Refresh
For i = 0 To 4
Text1(i).Enabled = False
Next i
CmdSave.Enabled = False
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
Select Case Index
Case Is = Index
If KeyCode = vbKeyReturn And Index < 4 Then Text1(Index + 1).SetFocus '回车获得焦点
If KeyCode = vbKeyReturn And Index = 4 Then CmdSave.SetFocus
If KeyCode = vbKeyUp And Index > 1 Then Text1(Index - 1).SetFocus
End Select
End Sub
出现错误调试时Adodc1.RecordSource = "select * from 充电架信息表 order by 充电架信息"
Adodc1.Refresh
有问题,不知道怎么改,求高手赐教,谢谢!! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询