PC Review


Reply
 
 
Emma
Guest
Posts: n/a
 
      10th Nov 2008
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
 
Reply With Quote
 
 
 
 
Emma
Guest
Posts: n/a
 
      10th Nov 2008
On my other form using the same code it says you can't go to the specified
record, which is what I'd like it to say


"Emma" wrote:

> 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

 
Reply With Quote
 
Graham Mandeno
Guest
Posts: n/a
 
      10th Nov 2008
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" <(E-Mail Removed)> wrote in message
news:692C84C9-277A-4A50-AAE8-(E-Mail Removed)...
> 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



 
Reply With Quote
 
Emma
Guest
Posts: n/a
 
      10th Nov 2008
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" wrote:

> 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" <(E-Mail Removed)> wrote in message
> news:692C84C9-277A-4A50-AAE8-(E-Mail Removed)...
> > 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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repair code for acNext if there is no next record =?Utf-8?B?U2lnbm1hbiBEYXZpZA==?= Microsoft Access VBA Modules 6 29th Mar 2007 04:37 PM
Form Current - iif [Ignore]=Yes DoCmd.GoToRecord , , acNext =?Utf-8?B?TWFya0BNYXR6a2UuVVM=?= Microsoft Access ADP SQL Server 2 20th Apr 2006 04:43 PM
Form, Current - iif [Ignore]=Yes DoCmd.GoToRecord , , acNext =?Utf-8?B?TWFya0BNYXR6a2UuVVM=?= Microsoft Access Form Coding 2 15th Apr 2006 04:39 PM
Stop error 2105 using Gotorecord acnext? =?Utf-8?B?Q2hyaXMgV2FpbndyaWdodA==?= Microsoft Access VBA Modules 1 5th Apr 2006 12:46 AM
AcNext on subform doesn't work! Robert Microsoft Access Form Coding 1 26th Jan 2004 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:31 PM.