如果要通过将信息填入文本框,向Access表中添加一条数据,但可以允许某些文本框(即表中的某些列为空),应该怎么做呢?现在是这样:
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields("设备类别") = Text1.Text
Adodc1.Recordset.Fields("设备名称") = Text2.Text
Adodc1.Recordset.Fields("设备编号") = Text3.Text
Adodc1.Recordset.Fields("数量") = Text4.Text
Adodc1.Recordset.Fields("单价") = Text5.Text
Adodc1.Recordset.Fields("生产厂家") = Text6.Text
Adodc1.Recordset.Fields("购买日期") = DT1.Value
Adodc1.Recordset.Fields("主要性能指标") = Text8.Text
Adodc1.Recordset.Fields("保管人") = Text9.Text
Adodc1.Recordset.Fields("经费来源") = Text10.Text
Adodc1.Recordset.Update
但是只有将所有的文本框内容都填进去,才能成功添加。