| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1395 人关注过本帖
标题:access 运行时错误‘3001’ 无效参数
只看楼主 加入收藏
giinthesky
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2021-12-22
收藏
 问题点数:0 回复次数:0 
access 运行时错误‘3001’ 无效参数
求助大神,我在窗体上数据录入完成后,运行程序就报错,运行到 add_rs.AddNew 这一步时就提示:运行时错误‘3001’ 无效参数,请问大神们是什么问题,该怎么处理?万分感谢!!!!

完整代码如下:

Private Sub Command0_Click()
  If IsNull(Text16) = True Then
      MsgBox "请输入车牌号码!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Text18) = True Then
      MsgBox "请输入品牌!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo30) = True Then
      MsgBox "请输入车型!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo32) = True Then
      MsgBox "请输入排量!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo34) = True Then
      MsgBox "请输入座位数!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo36) = True Then
      MsgBox "请输入所有人!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo38) = True Then
      MsgBox "请输入来源!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Text40) = True Then
      MsgBox "请输入登记日期!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo73) = True Then
      MsgBox "请输入车辆使用性质!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Text42) = True Then
      MsgBox "请输入发动机号!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Text43) = True Then
      MsgBox "请输入车辆识别号!", , "系统提示"
      Exit Sub
  End If
  If IsNull(Combo71) = True Then
      MsgBox "请输入车况!", , "系统提示"
      Exit Sub
  End If
  Dim add_db As DAO.Database
  Dim add_rs As DAO.Recordset
  Set add_db = CurrentDb()
  Set add_rs = add_db.OpenRecordset("车辆资料", dbOpenDynaset)
  add_rs.AddNew
      add_rs!车牌号码 = Me!Text16
      add_rs!品牌 = Me!Text18
      add_rs!车型 = Me!Combo30
      add_rs!排量 = Me!Combo32
      add_rs!座位数 = Me!Combo34
      add_rs!所有人 = Me!Combo36
      add_rs!来源 = Me!Combo38
      add_rs!登记日期 = Me!Text40
      add_rs!发动机号 = Me!Text42
      add_rs!车辆识别号 = Me!Text43
      add_rs!车况 = Me!Combo71
      add_rs!保险起始日 = Me!Text44
      add_rs!保险截止日 = Me!Text47
      add_rs!交强险 = Me!Text49
      add_rs!商业险 = Me!Text51
      add_rs!三者险保额 = Me!Text53
      add_rs!保费合计 = Me!Text55
      add_rs!车船税 = Me!Text57
      add_rs!保险公司 = Me!Text59
      add_rs!联系电话 = Me!Text61
      add_rs![购置价(含税)] = Me!Text65
      add_rs![折旧(元/月)] = Me!Text67
      add_rs!使用性质 = Me!Combo73
  add_rs.Update
  add_db.Close
  Set add_db = Nothing
  Set add_rs = Nothing
  MsgBox "资产添加成功!", , "系统提示"
  On Error Resume Next
    Dim ctl As Control

    For Each ctl In Me
        Select Case ctl.ControlType
        Case acCheckBox
            ctl.Value = False
        Case Else
            ctl.Value = Null
        End Select
    Next
End Sub
搜索更多相关主题的帖子: 提示 系统 End Sub If 
2021-12-22 15:34
快速回复:access 运行时错误‘3001’ 无效参数
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014975 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved