Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What a Sub form does

Status
Not open for further replies.

tintin007

Technical User
Aug 11, 2000
8
0
0
CA
I have a problem with a button putting my form on a new record ... it work one time, the second time it said "you can't go to the specified record"

The only mean It work is when I put the focus on a sub-form in my master form between the two presses.

So, I want to simulate that for the error stopping to appear and occur... just putting a Resume Next create the need for my users to press the button twice instead of only one time.

Please Help [sig][/sig]
 
Hi!

I'm not sure I understand your challenge completely, but I've experienced the same error when trying to move to the next record when I'm alredy at a new record (at the end of the recordset).

This is how I awoid getting any messages in that case (the "whole clicking sub" for the on click event of the gotonext-button).

Expl; the sub only shows an error message if the error <> 2105 (which is &quot;you can't go to the specified record&quot;)

Private Sub cmbNext_Click()
On Error GoTo Err_cmbNext_Click
DoCmd.GoToRecord , , acNext
Exit_cmbNext_Click:
Exit Sub
Err_cmbNext_Click:
If Err.Number <> 2105 Then
MsgBox Err.Description
End If
Resume Exit_cmbNext_Click
End Sub

Hope you can use it;-)

Roy-Vidar [sig][/sig]
 
Ok ... I've tried it and it work but it require me to push the button twice to ADD another record

Do you have any other advice

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top