Add Record command button error message

  • Thread starter Thread starter Tracy
  • Start date Start date
T

Tracy

Hi,

I added a command button to my main form that would allow the user to add a
new record. However, when I click on it I get an error message saying, 'You
can't go to specified record.' Here is my code:

Private Sub AddRec_Click()
On Error GoTo Err_AddRec_Click


DoCmd.GoToRecord , , acNewRec

Exit_AddRec_Click:
Exit Sub

Err_AddRec_Click:
MsgBox Err.Description
Resume Exit_AddRec_Click

End Sub

Any suggestions on how I can get this to function correctly? Thanks.
 
Hi Bob,

The allowAdditions property is true yet I noticed the data entry property is
false, shouldn't that be set to true, and could that be causing the problem?
Thanks.
 
No. The Data Entry property doesn't determine whether records can be added;
it only determines whether existing records are displayed.
 
Back
Top