acNext

E

Emma

Hi I'm using the following to go to the next record. However I like that it
creates a new record when it gets to the end of the list but I don't want the
user to be able to just keep clicking next and creating many blank records.
Is there any way around this?

Private Sub Command116_Click()
On Error GoTo Err_Command116_Click


DoCmd.GoToRecord , , acNext

Exit_Command116_Click:
Exit Sub

Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click

End Sub
 
E

Emma

Hi I'm using the following to go to the next record. However I like that it
creates a new record when it gets to the end of the list but I don't want the
user to be able to just keep clicking next and creating many blank records.
Is there any way around this?

Private Sub Command116_Click()
On Error GoTo Err_Command116_Click


DoCmd.GoToRecord , , acNext

Exit_Command116_Click:
Exit Sub

Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click

End Sub
 
G

Graham Mandeno

Hi Emma

This won't happen, unless you have some code somewhere that writes data into
a new record, thereby making it dirty.

If you are already on a new, undirtied record, a request to go to the next
record will do nothing.
 
E

Emma

Yes I was trying to write the current users name into the new record, once I
got rid of that code it worked, thanks alot! I now know what a dirty record
is,thanks


Graham Mandeno said:
Hi Emma

This won't happen, unless you have some code somewhere that writes data into
a new record, thereby making it dirty.

If you are already on a new, undirtied record, a request to go to the next
record will do nothing.
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Emma said:
Hi I'm using the following to go to the next record. However I like that
it
creates a new record when it gets to the end of the list but I don't want
the
user to be able to just keep clicking next and creating many blank
records.
Is there any way around this?

Private Sub Command116_Click()
On Error GoTo Err_Command116_Click


DoCmd.GoToRecord , , acNext

Exit_Command116_Click:
Exit Sub

Err_Command116_Click:
MsgBox Err.Description
Resume Exit_Command116_Click

End Sub
 

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