I get an error when I try to put a "1" in a field inside a table...this is the code I'm using:
Dim db As Database
Dim rst1 As Recordset
Set db = CurrentDb
Set rst1 = db.OpenRecordset("NewDB"
rst1.AddNew
rst1![Units] = "1"
rst1.Update
(It gives an error of "Index or Primary Key cannot contain a Null value"
NewDB is my table and Units is the field I want to write a "1" into.
Is there a better way to write info into a table's field?
thank you!
Dim db As Database
Dim rst1 As Recordset
Set db = CurrentDb
Set rst1 = db.OpenRecordset("NewDB"
rst1.AddNew
rst1![Units] = "1"
rst1.Update
(It gives an error of "Index or Primary Key cannot contain a Null value"
NewDB is my table and Units is the field I want to write a "1" into.
Is there a better way to write info into a table's field?
thank you!