Add Record command button error message

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.
 
T

Tracy

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.
 
D

Douglas J. Steele

No. The Data Entry property doesn't determine whether records can be added;
it only determines whether existing records are displayed.
 

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