Add Record Not Working

  • Thread starter Carol Spears via AccessMonster.com
  • Start date
C

Carol Spears via AccessMonster.com

I have a form with an ADD RECORD button. When I click on this button it
should take me to a form to add a record. It does, but the records are not
updateable.
Here's my code...

On Error GoTo Err_AddRcd_Click


DoCmd.OpenForm "frmStudAdd", acNormal, "", "", acAdd
Me.AllowAdditions = True
Me.AllowEdits = True


Exit_AddRcd_Click:
Exit Sub

Err_AddRcd_Click:
MsgBox Err.Description
Resume Exit_AddRcd_Click

End Sub

Can anyone help me?
 
R

Rick B

Can you add records to that form? Is it based on an updateable query?

Take the button out of the equation for a second and just open the form.
Can you add a new record? If not, try opeingin the query. Can you add a
record? If not, then you must have a non-updateable query. You need to
simplify the query.

Break it down and let us know what the issue is.

Rick B
 
A

Al Camp

Carol,
Check the underlying query for the form. Run the query, and see if it
has a * (New Rec) enabled in the nav buttons.
Sounds like the query itself is not updateable... and therefore neither
is the form.
hth
Al Camp
 
C

Carol Spears via AccessMonster.com

From the main form, *(newrcd) on the bottom nav is possible. When I click
on it, it takes me to the blank form. But using the ADD Record button with
the above code, takes me to a blank record on the ADDRcd form, but the form
is not updateable.

I have placed Me.allowedits=true on the ADDRcd form, but it still comes up
uneditable and the nav buttons at the bottom are greyed out.
 
A

Al Camp

Carol,
Try this...

DoCmd.OpenForm "frmAddresses", , , , acFormAdd

If your form has AllowAdds=false or AllowEdits = false then turn them on,
but if not... you shouldn't have to deal with them at all.

I think your problem is the ("") in the Filter and Where arguments of the
OpenForm function. If it's a New record, there should be no Filter or Where
argument, and especially not NULL.
hth
Al Camp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top