M
max
Hi all,
I really do not have a clue why I get an error in the following situation.
I have this code associated to a cmd button on a form, to move to the
previous record:
------------------ start of code --------------------------
Private Sub cmdUndoNew_Click()
On Error GoTo Err_cmdUndoNew_Click
DoCmd.RunCommand acCmdRecordsGoToPrevious
medNum.SetFocus
Exit_cmdUndoNew_Click:
Exit Sub
Err_cmdUndoNew_Click:
MsgBox Err.Description
Resume Exit_cmdUndoNew_Click
End Sub
------------------ end of code -------------------------
this button appears when the recordset moves to a new record. Normally
pressing this button, provided that nothing has been written in the new
record (otherwise the button automatically disappear), the recordset moves
to the previuos record, the last of the recordset, canceling the new record
that was going to be filled in.
This button works perfectly using the form normally, while it gives the
error "the command or action CmdRecordsGoToPrevious isn't available now".
Does anybody have an idea why this is happening?
many thanks
Max
I really do not have a clue why I get an error in the following situation.
I have this code associated to a cmd button on a form, to move to the
previous record:
------------------ start of code --------------------------
Private Sub cmdUndoNew_Click()
On Error GoTo Err_cmdUndoNew_Click
DoCmd.RunCommand acCmdRecordsGoToPrevious
medNum.SetFocus
Exit_cmdUndoNew_Click:
Exit Sub
Err_cmdUndoNew_Click:
MsgBox Err.Description
Resume Exit_cmdUndoNew_Click
End Sub
------------------ end of code -------------------------
this button appears when the recordset moves to a new record. Normally
pressing this button, provided that nothing has been written in the new
record (otherwise the button automatically disappear), the recordset moves
to the previuos record, the last of the recordset, canceling the new record
that was going to be filled in.
This button works perfectly using the form normally, while it gives the
error "the command or action CmdRecordsGoToPrevious isn't available now".
Does anybody have an idea why this is happening?
many thanks
Max