Using a command button to add a new record

  • Thread starter Thread starter Mari
  • Start date Start date
M

Mari

I'm doing something very simple in Access 97 that I can't
get to work. I'm using a command button to create a new
record in a table. One of the fields on the form is an
AutoNumber field. I used a wizard to create the command
button and I selected Add New Record in the wizard
process. This gives me.....DoCmd.GoToRecord,,acNewRec.
When I test the button I get the following
message...Invalid Use of Null. I also get a message that
tells me that I cannot make updates to a form while in
design view and that I should change to form view to a
different view. (I can't quite recall the exact message
but I'm running the form while testing). I'm a novice at
this and wondering if anyone has any suggestions. Thanks.
 
Check the properties of the form.
In the data tab, is the "Recordset Type" set to Dynaset??? as you can't
add new records to the "Snapshot" type.
and check the Allow Additions property on the data page also, it needs to
be set to yes.

Are you sure the the "invalid use of null" msg is not coming from the record
you are moving "off" ie, during the save operation...
It sounds like it might be....
 
Back
Top