GoToRecord error 2105

Hello. I can't seem to trap this error!

I have a command button to take you to the next record. If there is not a 
"next record" I'd like a message box stating "you've reached the end of the 
list", instead of the dreaded "run-time error 2105 you can't go to the 
specified record".

When I step through my code, the error doesn't seem to get pegged as 2105 
and the message box doesn't appear. I must have something backwards! I'd 
appreciate your help. Thanks!

Private Sub NextPP_Click()
Dim lngErr As Long

lngErr = Err.Number
    If (lngErr <> 0) And (lngErr = 2105) Then
        MsgBox "That's the last entry in the list.", _
                   vbInformation, "End of the list..."
      Else
      DoCmd.GoToRecord , , acNext
    
    End If
    
On Error GoTo ProcError

ExitProc:
    Exit Sub
ProcError:
    MsgBox "Error " & Err.Number & ": " & Err.Description, , _
               "Error in NextPP_Click procedure..."
    Resume ExitProc
  
End Sub




0
Utf
7/26/2007 3:04:02 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
2653 Views

Similar Articles

[PageSpeed] 12

It's your

DoCmd.GoToRecord , , acNext

statement that raises the error. Check Err.Number before you execute that 
statement won't help in any way.

Try:

Private Sub NextPP_Click()
On Error GoTo ProcError

  DoCmd.GoToRecord , , acNext

ExitProc:
  Exit Sub

ProcError:
  Select Case Err.Number
    Case 2105
      MsgBox "That's the last entry in the list.", _
        vbInformation, "End of the list..."
    Case Else
      MsgBox "Error " & Err.Number & ": " & Err.Description, , _
        "Error in NextPP_Click procedure..."
  End Select
  Resume ExitProc

End Sub


-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Stephanie" <Stephanie@discussions.microsoft.com> wrote in message 
news:226F1B11-0763-43C3-9444-5D3C10979CC6@microsoft.com...
> Hello. I can't seem to trap this error!
>
> I have a command button to take you to the next record. If there is not a
> "next record" I'd like a message box stating "you've reached the end of 
> the
> list", instead of the dreaded "run-time error 2105 you can't go to the
> specified record".
>
> When I step through my code, the error doesn't seem to get pegged as 2105
> and the message box doesn't appear. I must have something backwards! I'd
> appreciate your help. Thanks!
>
> Private Sub NextPP_Click()
> Dim lngErr As Long
>
> lngErr = Err.Number
>    If (lngErr <> 0) And (lngErr = 2105) Then
>        MsgBox "That's the last entry in the list.", _
>                   vbInformation, "End of the list..."
>      Else
>      DoCmd.GoToRecord , , acNext
>
>    End If
>
> On Error GoTo ProcError
>
> ExitProc:
>    Exit Sub
> ProcError:
>    MsgBox "Error " & Err.Number & ": " & Err.Description, , _
>               "Error in NextPP_Click procedure..."
>    Resume ExitProc
>
> End Sub
>
>
>
> 


0
Douglas
7/26/2007 3:32:07 PM
Thanks for the post and the lesson!

"Douglas J. Steele" wrote:

> It's your
> 
> DoCmd.GoToRecord , , acNext
> 
> statement that raises the error. Check Err.Number before you execute that 
> statement won't help in any way.
> 
> Try:
> 
> Private Sub NextPP_Click()
> On Error GoTo ProcError
> 
>   DoCmd.GoToRecord , , acNext
> 
> ExitProc:
>   Exit Sub
> 
> ProcError:
>   Select Case Err.Number
>     Case 2105
>       MsgBox "That's the last entry in the list.", _
>         vbInformation, "End of the list..."
>     Case Else
>       MsgBox "Error " & Err.Number & ": " & Err.Description, , _
>         "Error in NextPP_Click procedure..."
>   End Select
>   Resume ExitProc
> 
> End Sub
> 
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Stephanie" <Stephanie@discussions.microsoft.com> wrote in message 
> news:226F1B11-0763-43C3-9444-5D3C10979CC6@microsoft.com...
> > Hello. I can't seem to trap this error!
> >
> > I have a command button to take you to the next record. If there is not a
> > "next record" I'd like a message box stating "you've reached the end of 
> > the
> > list", instead of the dreaded "run-time error 2105 you can't go to the
> > specified record".
> >
> > When I step through my code, the error doesn't seem to get pegged as 2105
> > and the message box doesn't appear. I must have something backwards! I'd
> > appreciate your help. Thanks!
> >
> > Private Sub NextPP_Click()
> > Dim lngErr As Long
> >
> > lngErr = Err.Number
> >    If (lngErr <> 0) And (lngErr = 2105) Then
> >        MsgBox "That's the last entry in the list.", _
> >                   vbInformation, "End of the list..."
> >      Else
> >      DoCmd.GoToRecord , , acNext
> >
> >    End If
> >
> > On Error GoTo ProcError
> >
> > ExitProc:
> >    Exit Sub
> > ProcError:
> >    MsgBox "Error " & Err.Number & ": " & Err.Description, , _
> >               "Error in NextPP_Click procedure..."
> >    Resume ExitProc
> >
> > End Sub
> >
> >
> >
> > 
> 
> 
> 
0
Utf
7/26/2007 4:16:04 PM
Reply:

Similar Artilces:

Outlook 2000 Error #11
I had to re-install Windows and all programs and now when I try to send/receive mail through Outlook 2000 it gives me the message that Internet Mail is not regestered properly. Please re-install and try again. I use the Office 2000 CD and have used the repair function to re- install and finally totally un-install and re-install and I always get the same message. I am running Windows 98SE. It worked fine before I had to re-install. Any ideas or suggestions? Thanks for all of your help and input. Dale ...

Strange error.
I'm working with an OLEDB connection to a Microsoft Access database, coding in VB.net ' Connection String is set here (called from constructor) Private Function GetConnection() As OleDb.OleDbConnection Return New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB. 4.0;" _ & "Data Source=" & mDataPath & "\DAQ.mdb") End Function ' Sub that's throwing the error: Public Sub insertStart(ByVal sTime As Date, ByVal jobID As Integer) Dim sql As String = "EXECUTE startTheor" insCmd = New Ole...

Invalid month in Project Accounting error
When entering the project number in the Billing Entry screen in Project Accounting, I receive the following error: Unhandled script exception: Invalid month '0' in date function. Script terminated. EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE SCRIPT_CMD_SETDATE This is currently only happening for one particular customer. I can't find anything in the knowledge base. Does anyone have a solution. Thanks, Eric ...

RDC Error
Hi - I know there is a fix for this error somewhere in the "bowels" of MS KB articles, I just can't seem to find it after numerous searches. The fix has to do with deleting some registry keys then using RDC as admin to reset the security keys or something to that effect. It only seems to pop up whenever there is a "patch update" to which then I can no longer RDC. If anyone could point me in the right direction. Thanks!!! Found it... http://support.microsoft.com/default.aspx/kb/187614 "Awrex" wrote: > Hi - > > I kno...

MAPI Error
Hello We have a webpage that has a link to a custom form. Whenever anyone using Outlook XP clicks the link to open the form the following error appears: Internal MAPI Error: An invalid parameter was passed to a MAPI function Contact your administrator However, we can save the form, and there are no issues at all with Windows 2000 Can anyone help please Thanks in advance Glenn Kelly ...

Error on Login
Fresh install of CRM 3.0 on SBS 2K3 box. Tons of Ram (1gig free). I can login as the system administrator, but can't login as any other user. I have enabled the other users, but I get an error each time I login. The only thing it says is: ERROR. An Error has occoured. Contact your systems administrator for more information..... then I have a Try Again or Close button. If I hit try again, it does the same thing. Now, if I'm trying to login from the CRM server.... I don't even get that far with the any account. I just get the login window three or four times and th...

can not send without error code
Hi, kindly help me. Out of sudden I can not send my email, but I still can receive email. My outgoing email just sitting in the outbox. I try send and receive several times, there is no error code but they only receiving without even try to send I do not change anything in the setting and even truy to recheck all the setting (SMTP, etc) and everything still ok need your immediate response, many thanks in advance How to Remove a Stuck Undeletable Message in Windows Mail http://www.vistax64.com/tutorials/62560-windows-mail-problems.html WMUtil http://www.oehelp.com/WMUtil/De...

Outlook Error after URL change
We have already configured our internal DNS records to support crm.domain.com to point to the proper machine, and created the host headers on the web server. How do we get CRM to switch from "server1" to crm.domain.com? In a nutshell, we renamed the server from an internal name to a FQDN. Internally the CRM server still believes it is on http://server1 We are trying to access it now on http;//crm.domain.com. Our outlook worked properly before we made this change. After the change, only the web works and the outlook after a uninstall and reinstall, switching the server name whil...

TCP/IP error message
After moving and changing my account, I started getting an error message when sending a email saying that the TCP/IP conncection has been unexpectely terminated. However the message his being sent but it remains in my outbox. The service provider (SBC) is telling me it is an Outlook issue. Any ideas ? You might have to reset the tcp/ip "JP Peretz" <jpregs@sbcglobal.net> wrote in message news:1abc01c3fbff$9e6d47a0$a001280a@phx.gbl... > After moving and changing my account, I started getting > an error message when sending a email saying that the > TCP/IP connc...

Error running reports
I have created several custom reports and when previewing them in Visual Studio that run as expected. However, once I upload them to CRM I receive the following error message: Microsoft.Crm.CrmException: Thread.CurrentPrincipal is not a WindowsPrincipal Has anyone come across this before? ...

Public Folders 503 Error
I've got a back-end server running Exchange 2003 and a Front End server connected running Exchange 2003. The outlook web access works just fine on the front end server, except for when I click on the Public Folders I receive a HTTP 1.1 503 Service Unavailable. I have followed Microsoft's KB 823159 about troubleshooting a 503 Error, and none of the symptoms described really match. My services are all running as local system accounts, my services are all running, I am not receiving errors about the Registry Key that exceeds 259 characters, nor do I have any GPO policies in place. The...

# DIV/0! error in Excel
I have a function that divides two numbers, sometimes those numbers are 0 so the result is # DIV/0!. My second function is based on the result of the first function. Since there isnt always data available for the first function I get the # DIV/0! error and my final calculation wont calculate. I need the final calculation to disregard any 0 cells or # DIV/0! errors and still calculate the data that is available. Hi You need to wrap your division with an IF() so it will evalluate the result before it puts anything in the cell. Try something like: =IF(A2>0,A3/A2,0) -- Andy. "He...

Timeout error in incident.update
I have an incident.update line in my post callout. No matter how simple the update strIncidentXml is, I always get timeout error from the server. Afterwards I changed my mind and decided to use SQL update statement to update the incidentbase table. Again I get timeout expired message (ErrorMessage: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding) What can be causing this? Why am I not being able to update incidents? Thanks in advance for your ideas. ...

forumula too long error
i cannot add terms to this equation...i just need a couple more! does anyone have any ways around this? here is the formula...it is a compounding formula: =(1+C5)*(1+C6)*(1+C7)*(1+C8)*(1+C9)*(1+C10)*(1+C11)*(1+C12)*(1+C13)*(1+C14)*(1+C15)*(1+C16)*(1+C17)*(1+C18)*(1+C19)*(1+C20)*(1+C21)*(1+C22)*(1+C23)*(1+C24)*(1+C25)*(1+C26)*(1+C27)*(1+C28)*(1+C29)*(1+C30)*(1+C31)*(1+C32)*(1+C33)*(1+C34)*(1+C35)*(1+C36)*(1+C37)*(1+C38)*(1+C39)*(1+C40)*(1+C41)*(1+C42)*(1+C43)*(1+C44)*(1+C45)*(1+C46)*(1+C47)*(1+C48)*(1+C49)*(1+C50)*(1+C51)*(1+C52)*(1+C53)*(1+C54)*(1+C55)*(1+C56)*(1+C57)*(1+C58)*(1+C59)*(1+C60...

Installing CRM3, multiple errors
I have installed CRM3 on a clean SBS2003 machine (under VirtualPC), but have got a series of errors and cannot now acess CRM at all. I followed the steps in the Implmentation Guide. I had to change the web site port to be 80 and the alias to be able to access it (as crm3demo). I installed CRM3 under Administrator login and was initially able to open CRM correctly, login as Administrator, go into the Administrator user and uncheck the restricted access check box. Everything appeared normal. Then I set up the sample data users in Active Directory and tried installing the sample data by ...

OFXIE12045 error message connecting to Schwab
Hi Everyone, I just started getting this message updating my Charles Schwab account -- it says It can't establish a secure connection b/c I dont' have the needed security components. I'm running M07 with Vista -- been working great up until today. any ideas? thanks! I am also getting a message that Money H&B 2008 cannot update my Schwab files. It was working fine earlier in the day but just started having the problem. I suggest waiting until tomorrow morning to see if it is a Schwab problem and clears up. I would appreciate it if you would update your status when ...

How to place focus back after error message window closed?
I have a form with 3 CEdit which are Year, Month and Day fields. If one of them is empty and user click OK or press Enter, an error message will displayed and the focus will back on where it was. I have tried this code but it won't focused back on where it was, it just back to the form but nothing is focused. void CMochikoshiDlg::OnOK() { // TODO: この位置にその他の検証用のコードを追加してください if ( m_edt_mochi_date_year.IsEmpty() || m_edt_mochi_date_month.IsEmpty() || m_edt_mochi_date_day.IsEmpty() ) { MessageBox( "Error" ); return; } CDialog::OnOK(); } How to do that? Thank you ve...

unrealized gain report errors
This just started in '04. I'm running Mony 99 Financial Suite v7.0. When I record the sale of a partial lot of stock, the cost column is not updating to reflect the cost accross a smaller number of shares. i.e. - I have 200 shares of xyz at a cost of $10/ea for a total lot cost of $2000. Prior to entering a partial lot sale, the unrealized gain calc is correct. When I enter a partial sale of 50 shares, the cost column remains fixed at $2000 rather than recalculating the cost basis at $1500. The unrealized gain is now calculated at current price - $13.33 ($2000/150 shares...

Microsoft Document Connection for Mac
When I connect to Share Point through Microsoft Document Connection for Mac and attempt to Edit or Check Out a document (whether Word or Excel) when Excel or Word attempts to open up the document an error shows up stating " 'up to the first 15 characters of the document name' could not be found." I assumed it was an issue with long file names and lowered the file name to 7 characters with no spaces and still get the same error. I am using Mac OS X Snow Leopard (10.6.1) with the latest version of Office 2008. Jeremy Combs wrote: > When I connect to Share Point through M...

VC++ 2005
I am attempting to compile a project in Visual Studio 2005 which compiles and links properly in VC++ 6.0. It seems to have problems with C++ i/o functions. Here is the error I get: g:\src\analyzer\digitdialpages.h(136) : error C2146: syntax error : missing ';' before identifier 'm_InFile' Line 136: ifstream m_InFile; The statment: include <fstream> is at the top of the source file. Some assistance would be helpful. We didn't have any problems with using ifstream or ofstream in VC++ 6.0. Thanks. On Tue, 12 Dec 2006 18:22:47 -0500, "Raj Kulkarni...

Exchange 5.5 Error Message "Application Log Full"
This is the relavent information from the Application Log: Event ID: 2125 Source: MSExchnageMTA Type: Warning Catagory: Resource Description: Statistics for the DBI call (DB Server): file writes GATEWAY, reads 37, cache hits 275, misses %5. Attribute %6, value number %7, Object ID: %8 (00000000 => N/A). Caller %12 [%9 %10 %11] (8) I'm having a hard time making sense of this error message. Vaguely, it looks like a system call to a DB server that is misbehaving in some way. I've tried restarting the MSExchangeMTA service, to no avail. Can somone point me in the right dire...

Strange error...
Hi All, I have following 2 files in my project. //MLCommand.h typedef struct { char Name[25]; // Command Name BYTE numParams; // Number of Parameters void *params[ML_MAX_PARAMS]; }ML_Command; //MLC.h class ML { public: ....... ....... static ML_Error Configure (LPCTSTR INIFILE, void (*statusTarget)(char*,int,int)); static ML_Error SetTraceLevel (BYTE traceLevel); static ML_Error SetPortAndWindowHandle (char* PortName, HWND hwnd); ...... ...... }; when I compile the project I am getting following errors: mlcommand.h(23) : error C2146: syntax error : missing ';' before identifie...

POP3 connector errors
Hello, I have regularly errors because a too last longing response of the POP server. Is there a way to increase any time-out that would minimise this problem. Thanks for any info, Jean-Jacques ...

Error - Did not CLose Before Exiting
I'm receiving an error.. "...did not close the file before exiting" Money needs to verify the information in your file When I click Yes I then recevie the error.... "The email address or Password is in correct" ....if you are opening an existing file, sign in without access to online services. I know the password is correct as I have not changed it and it works with an older version of this file(from 1-month ago). I've tried to repair the current file, but was unsuccessful How can I sign in offline? Hello: My recommendation is to restore a ...

Microsoft Outlook 2000 Error Report
Hi, Just to get helps on the following : I've the Microsoft Outlook 2000 (come with Ms Office 2000 Premium with full installation) installed on the Windows XP Professional with Service Pack 1. Had configured the corporate Internet Email as well. The problem is when sometime trying to type a new or replied or forwarding of email which is going to be send out, then will prompt the error report message. After i click on do not send, then it will straight away closed the whole Outlook 2000 application & the mail without saved the message. So i've to re-open again and re-type...