The user not able to submit the Form and get the Error: “Invalid use of Null”

醉酒当歌 提交于 2019-12-02 08:35:15

As a general rule, anytime you going to run reports, query additional data, you would do BEYOND well to FIRST save the current record in the current context. In addition, if this is a new record, then un-like Access tables, the default values, and PK generation does NOT occur until such time you saved the current record.

so, in you code, you want to safe tuck away the current record. This will allow SQL server to setup the PK values and any default columns. So

Private Sub cmdPostSubmit_Click()
 postSubmit = 1
 postOnly = 0

 If me.Dirty = True then me.Dirty = False   ' save current record to table.

The other issue is does your code work for existing records, and not new ones, or does it always error out?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!