Reputation: 879
I want a new entry created in table Moments using the predefined defaults for each field.
I've tried the following lines and I'm getting a syntax error for both. What would be the correct method to do this in Access?
INSERT INTO Moments VALUES ()
Access highlights the end bracket after clicking ok on syntax error.
and
INSERT INTO Moments () VALUES ()
Access highlights the first bracket after clicking ok on syntax error.
and
INSERT INTO Moments default values
Access highlights default after clicking ok on syntax error.
Upvotes: 2
Views: 43
Reputation: 32682
In VBA, this can easily be achieved with recordsets:
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Moments") 'Open table
rs.AddNew 'Add row
rs.Update 'Commit to table
Upvotes: 2