Add new record error - autonumber PK the problem?

  • Thread starter bmiller via AccessMonster.com
  • Start date
B

bmiller via AccessMonster.com

Going nuts...
I have a subform which is populated by a query. The problem is when I try to
add a new record I get an error message (see below) that pops up, yet then
allows me to go ahead and add the details I want and everything seems fine -
it saves in the datasheet view. When I go to add a new record, I get the
error message again...

"You can’t assign a value to this object

The object may be a control on a read-only form.
The object may be on a form that is open in design view
The value may be too large for this field"

Is the PK being an autonumber the cause? How do I solve?

I have read as many threads as I can stand and yet to find the answer...
however, I have checked the following:-
1) no default values in tables causing problems
2) master and child links seem right
3) allow edits/additions etc all YES
4) recordsets are all dynaset
5) when I use the subforms as stand alone forms it all works fine (but this
is not the what I want)
6) I am using autonumber as a unique identifier, not for a meaningful value

I have included the code below on the add record button (wizard designed) in
case this is the answer

Private Sub btnCandidateFormAdd_Click()
On Error GoTo Err_btnCandidateFormAdd_Click


DoCmd.GoToRecord , , acNewRec

Exit_btnCandidateFormAdd_Click:
Exit Sub

Err_btnCandidateFormAdd_Click:
MsgBox Err.Description
Resume Exit_btnCandidateFormAdd_Click

End Sub


Any help very appreciated. I am a novice and spending way too much time on
this for my sanity

Bruce
 

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