error 2105

C

Cmenkedi

Hello,
This was working fine until today.
I have a form with a subform. When I enter in the information on the form, I
have an "Add" button that moves the information to the subform. Today when I
tried to use it, it is giving me a runtime error 2105 and highlights my docmd
line. Please help me figure out what the problem is.

Private Sub cmdAdd_Click()

Me.subForm.SetFocus
DoCmd.GoToRecord , , acNewRec
Form_frmInventoryTransaction.TransactionDate = Me.txtDate
Form_frmInventoryTransaction.Received = Me.txtReceived
Form_frmInventoryTransaction.AdjustedIN = Me.txtAdjustedIN
Form_frmInventoryTransaction.AdjustedOUT = Me.txtAdjustedOUT
Form_frmInventoryTransaction.Comment = Me.memoComment
Me.Refresh



Me.txtReceived = 0
Me.txtAdjustedIN = 0
Me.txtAdjustedOUT = 0
Me.memoComment = ""
Me.txtReceived.SetFocus

If Me.RecordsetClone.RecordCount > 1 Then
DoCmd.GoToRecord , , acNext
End If
End Sub

Thank you
 
B

Beetle

The error is telling you it can't go to a New Record. There are a few things
that could cause this.

For example, Access attempts to save before navigating to another record,
so if there is something, like a required field that hasn't been filled out,
that causes the save to fail, then your DoCmd.GoToRecord will fail.

Another possibility is that somehow the subforms Allow Additions
property got set to No (False).
 
C

Cmenkedi

I have checked and the Allow Additions is set to yes. What has me puzzled is
that it worked fine up until yesterday. Now it doesn't matter if my main form
is filtered or not.
 
B

Beetle

Can you move to a new record in the sub form using the standard
navigation buttons, and not your command button?

If you have a recent backup, is that still working normally?
 

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

Similar Threads


Top