On Error of an On Error

How do I write an On Error of an On Error?  For example, if an error
occurs when trying to open a linked table, I would like to open up the
linked table manager for the user to link the tables properly.
However, if that is not installed, I would like to give the user a
error message that I will write.  At the moment, my code which errs
out is as follows:

========================
Private Sub Form_Current()

' Checks to see if all table is there
    On Error GoTo TableMgr

    If (DCount("*", "qReport") > 0) Then
    MsgBox "This should not be 0.", vbOKOnly, "Not 0"

    End If

Exit Sub

TableMgr:
    MsgBox "The Linked Table Manager will open.", vbOKOnly, "Table
Manager"
    Application.Run ("acwztool.att_Entry")
        On Error Resume Next 'GoTo NeedToInstallLinkedTableManager

NeedToInstallLinkedTableManager:
    MsgBox "The Linked Table Manager needs to be installed.",
vbOKOnly, "The Linked Table Manager add-on needs to be installed."

End Sub

========================

Thank You!
-1
none
11/16/2007 2:50:25 AM
access 16762 articles. 3 followers. Follow

6 Replies
1324 Views

Similar Articles

[PageSpeed] 6

You can nest On Error without any problems. The problem with your code is
that you have the 'On Error Resume Next' *after* you issue the Application.
Run.

The code should be:

On Error Goto NoTableManager
     Application.Run
On Error Goto 0 'Clears the error and revert to the earlier error handling's
behavior

Exit Sub

NoTableManager:

Your Message box here

End Sub

none wrote:
>How do I write an On Error of an On Error?  For example, if an error
>occurs when trying to open a linked table, I would like to open up the
>linked table manager for the user to link the tables properly.
>However, if that is not installed, I would like to give the user a
>error message that I will write.  At the moment, my code which errs
>out is as follows:
>
>========================
>Private Sub Form_Current()
>
>' Checks to see if all table is there
>    On Error GoTo TableMgr
>
>    If (DCount("*", "qReport") > 0) Then
>    MsgBox "This should not be 0.", vbOKOnly, "Not 0"
>
>    End If
>
>Exit Sub
>
>TableMgr:
>    MsgBox "The Linked Table Manager will open.", vbOKOnly, "Table
>Manager"
>    Application.Run ("acwztool.att_Entry")
>        On Error Resume Next 'GoTo NeedToInstallLinkedTableManager
>
>NeedToInstallLinkedTableManager:
>    MsgBox "The Linked Table Manager needs to be installed.",
>vbOKOnly, "The Linked Table Manager add-on needs to be installed."
>
>End Sub
>
>========================
>
>Thank You!

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/200711/1

1
BananaRepublic
11/16/2007 3:14:52 AM
Thank you for your reply.  Unfortunately, I had a error in the code
that I was trying to run.  So, basically, if it errs out because the
tables are not linked, it calls up the linked tables manager; if it
errs out because the linked tables manager is not installed, it gives
another message.

The code should have read:

========================
Private Sub Form_Current()

' Checks to see if all table is there
    On Error GoTo TableMgr

    If (DCount("*", "qReport") > 0) Then
    MsgBox "This should not be 0.", vbOKOnly, "Not 0"

    End If

Exit Sub

TableMgr:
    MsgBox "The Linked Table Manager will open.", vbOKOnly, "Table
Manager"
    Application.Run ("acwztool.att_Entry")
        On Error GoTo NeedToInstallLinkedTableManager

NeedToInstallLinkedTableManager:
    MsgBox "The Linked Table Manager needs to be installed.",
vbOKOnly, "The Linked Table Manager add-on needs to be installed."

End Sub

========================

However, this is not producing the behavior I was hoping for.  It
gives me a debug error if it can't find the linked tables manager.
Thank you!
2
none
11/16/2007 3:32:11 AM
It would be far easier for you to write your own code to relink the tables.

See http://www.mvps.org/access/tables/tbl0009.htm at "The Access Web" for 
one approach.

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


"none" <rwinter75@yahoo.com> wrote in message 
news:40641ff5-cb95-4bc4-8399-5f3336c8faad@c30g2000hsa.googlegroups.com...
> How do I write an On Error of an On Error?  For example, if an error
> occurs when trying to open a linked table, I would like to open up the
> linked table manager for the user to link the tables properly.
> However, if that is not installed, I would like to give the user a
> error message that I will write.  At the moment, my code which errs
> out is as follows:
>
> ========================
> Private Sub Form_Current()
>
> ' Checks to see if all table is there
>    On Error GoTo TableMgr
>
>    If (DCount("*", "qReport") > 0) Then
>    MsgBox "This should not be 0.", vbOKOnly, "Not 0"
>
>    End If
>
> Exit Sub
>
> TableMgr:
>    MsgBox "The Linked Table Manager will open.", vbOKOnly, "Table
> Manager"
>    Application.Run ("acwztool.att_Entry")
>        On Error Resume Next 'GoTo NeedToInstallLinkedTableManager
>
> NeedToInstallLinkedTableManager:
>    MsgBox "The Linked Table Manager needs to be installed.",
> vbOKOnly, "The Linked Table Manager add-on needs to be installed."
>
> End Sub
>
> ========================
>
> Thank You! 


0
Douglas
11/16/2007 11:35:48 AM
Or use the code at :-
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='BE_ReLink.mdb'
which does not need any action by the users.

Peter Hibbs.

On Fri, 16 Nov 2007 06:35:48 -0500, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:

>It would be far easier for you to write your own code to relink the tables.
>
>See http://www.mvps.org/access/tables/tbl0009.htm at "The Access Web" for 
>one approach.
1
Peter
11/16/2007 11:47:37 AM
Thank you for the references, I will look them up.  However, just for
my edification, if I should run into needing to have an error
statement from an error statement in the future, what is the syntax?
What signals the end of the first error statement so that I can have a
second error statement, without it giving me a debug error?

Thank you!
0
none
11/16/2007 3:16:56 PM
TableMgr:
    MsgBox "The Linked Table Manager will open.", vbOKOnly, "Table
Manager"
    On Error Resume Next
    Application.Run ("acwztool.att_Entry")
    If Err.Number <> 0 Then
      MsgBox "The Linked Table Manager needs to be installed.",
vbOKOnly, "The Linked Table Manager add-on needs to be installed."
    End If

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


"none" <rwinter75@yahoo.com> wrote in message 
news:731e2fee-c2f6-49d2-9576-397105a50d82@p69g2000hsa.googlegroups.com...
> Thank you for the references, I will look them up.  However, just for
> my edification, if I should run into needing to have an error
> statement from an error statement in the future, what is the syntax?
> What signals the end of the first error statement so that I can have a
> second error statement, without it giving me a debug error?
>
> Thank you! 


0
Douglas
11/16/2007 4:33:19 PM
Reply:

Similar Artilces:

ITEM.SEND ERROR
when trying to send an Access file (2003) via OL i receive an error 'A program is trying to send mail using Item.Send' any known reasons or fixes for that? ...

what are Compile Errors on Starting program?
How do i stop the above from happening They're caused by errors in code. But you'll have to do some detective work to find the workbook with the problem. Chip Pearson has some notes on how to diagnose startup errors: http://www.cpearson.com/excel/StartupErrors.htm And Jan Karel Pieterse has more notes: http://www.jkp-ads.com/Articles/StartupProblems.asp qs1 wrote: > > How do i stop the above from happening -- Dave Peterson ...

CRM Desktop Client Error (Microsoft.Crm.Config.Client.InstallPstAction)
Hi, I 've updated our CRM3 Enviroment up to CRM4, all works fine, exept some Desktop Client (only Online) where I receive following error message when I try to configure : 13:13:52|Verbose| Method exit: Microsoft.Crm.Config.Client.ClientConfig.Install| System.Collections.Hashtable 13:13:52| Error| Configuration exception.System.Exception: Fehler bei der Aktion Microsoft.Crm.Config.Client.InstallPstAction. ---> System.UnauthorizedAccessException: Fehler bei LaunchOutlookInstallerProcess. bei System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode,...

error
when i am opening the page its written that there is a error From http://guide.opendns.com/main?url=costomerror&client=ie6 Posted via DevelopmentNow.com Groups http://www.developmentnow.com/g/ ...

circular error w/o cell reference
I am getting a very annoying circular error msg but the cell reference is not showing up at the bottom of the screen. I have tried both enabling and disabling the Iteration function but it does not make a difference. I do see "table" references in the bottom for just a second like "table 3" which then become "Ready" - is that a clue to help me find the infringing cell? Many thanks! Maybe Stephen Bullen's utility will help find that circular reference. http://www.oaltd.co.uk/Excel/Default.htm Look for FindCirc.zip Remote Todd wrote: > > I am ...

250907
I found a dcoument explaining how to solve this problem : http://support.micorosoft.com/default.aspx/?scid=kb;en-us;250907 which mention, in Note, an hexadecimal value depending of the version of the service pack used. Does anyone know these values ? or a place where I could find them ? Thanks Run Windows Explorer to confirm that X:\Exchsrvr\Add-Ins contains the Imcadmin.dll file. Go to properties of this DLL. The file version is what you need to put in the 5.5 Admin. -- Hope that helps, Dan Townsend This posting is provided "AS IS" with no warranties, and confers no rights...

4.0 Client Config error
The Client config returns an error with this in the server log; Exception information: Exception type: HttpParseException Exception message: Could not create type 'Microsoft.Crm.Sdk.Crm2007.CrmDiscoveryServiceAD'. Request information: Request URL: http://toshiba2002:5555/MSCRMServices/2007/AD/CrmDiscoveryService.asmx Request path: /MSCRMServices/2007/AD/CrmDiscoveryService.asmx The web client works OK, and I also get this same error when I try to connect the DMManager. The Server is SBE. Any ideas? -- Thanx Grizz Dear see this http://support.micros...

Outlook Error When Sending
Hi, I'm getting the following error more and more when trying to send email or reply to email I've received. I'm using a POP3 account, and it's becoming a real pain. Any idea what's causing this or how it can be resolved? Thanks in advand for any help you can offer. Michael The message could not be sent because one of the recipients was rejected by the server. The rejected e- mail address was 'mhl38@msn.com'. Subject 'Re: Iowa Caucus Party!', Account: 'Michael', Server: 'mail.coloradofordean.org', Protocol: SMTP, Server Respons...

Error in creating contact using web service
Hi all, I found an example to create account using web service on http://msdn2.microsoft.com/en-us/library/aa613632.aspx I am calling this web service through my desktop application written in VB.Net. I have added the web reference and the code compiles with no error or warnings. But on the last statement which creates a contact in MS CRM Dim contactGuid As Guid = service.Create(contact) it gives me error as "Server is unable to process the request" The server is available and running fine. Can anybody please help me on this issue? Thanks in advance, -Imran use try catch...

Error 1706 in Outlook
I recently made configuration changes on three workstations (Win2k Pro). On one of the systems, it required Office (2000 Pro) to be reinstalled, which I did without problem. The exception being Outlook. I can use Outlook when I'm logged in as the administrator. However, if I log in as the user, attempting to open Outlook brings up the following: "Your computer has been upgraded from Windows 95 or Windows 98 to a later version of Windows. Outlook must configure itself for this version of Windows." (I did not upgrade from an earlier version of Windows.) I click OK and it attempt...

NtFrs error in event viewer
i have a windows 2003 SBS and the server is mainly used as a file server. exchange has been removed, wsus and sharepoint has also been removed. The server locks up and no users have access to it every 3 days and i have to reboot it to get everything to work again. I ran hardware tests and the hardware is good. I dont know if this error is the reason. Any advice will be appreciated. Event Type: Error Event Source: NtFrs Event Category: None Event ID: 13568 Date: 4/13/2010 Time: 8:07:18 PM User: N/A Computer: SERVER Description: The File Replication Service has de...

tprinter error when using same printer as printer1 and printer2
I have a toy store. I have created a custom 40 column receipt template that I would like to print after each transaction (in addition to the standard 40 column receipt). This custom receipt goes in the customer bag, and is handed to the gift wrapper, where they use the custom receipt as a "gift wrap guide". I have the receipt the way I like it. Now, I would like to add this to the transaction process, by activating "printer2" with the identical setting as "printer1", except using the custom template, rather than the default 40 column which is set on pri...

Visio Install Error
I just installed Visio. When I opened Excel, a Visio button was added to my menu bar. When I opened Word, a Visio button was not added to my menu bar. I received two screen errors: (1) Windows is searching for Insert Visio Button.DOT. To locate the file yourself, click Browse. (2) Problem with Shortcut {the item "Insert Visio Button.DOT that this shortcut refers to has been changed or moved, so this shortcxut will not longer work properly. Do you want to delete this shortcut? I answered no and the first screen came up again. I have looked for this file and cannot find i...

Timesheet Save error
I have sharepoint and project server 2007 installed on the same windows 2003 machine. The SQL 2005 database is on another machine . For some reasons i removed the machine1(having wss+projectserver) from active directory and later added it back. Since then i am not able to save timesheets . I get the following error " while communicating with the project server an error occurred. check connectivity with your administrator to determine if further action is necessary" any help in this would be appreciated. thanks in advance sukhi, what event logs do you get? Tha...

file permission error 05-19-10
I copied and pasted one page of text from the internet into a word doc, then edited it in word, with MS XP. tried to save it, and can't. got "file permission error." what the heck is this? never had this problem before. *Where* were you trying to save it? -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <...

Error Mail Excel with Macros
I'm using exchange 2000 server and office xp Outlook. When i try to send or receive a email on this machine i receive this error. There was a SMTP communication problem with the recipient's email server. Please contact your system administrator. <myname.mydomain.com #5.5.0 smtp;552 MS-Office file containing VBA macros found inside of the email> I did not notice the problem with the older computers. Thanks I have seen some people say that the sonicwall firewall vba filtering is what causes this. However, i disabled that feature and i still get the problem... but...

Toolbar button error?
In Excel 2003 I put a button on a custom toolbar - the button is the 'double bottom border' and is from the Customise-Format selection of buttons. However this button just gives me a single bottom border. I can get double borders in other ways, e.g. from the drop-down borders box, where the identical-looking button does give me a double bottom border. Is this an error, or am I missing something? Thanks, David Wheeler d.r.wheeler@btinternet.com Hi David does the same for me too ... so i think it's broken :( and while this is no help at all to you i'll say it anyway ...

CRM 3.0 applicaton Error using Report Scheduler
When trying to download a report within CRM or run the report scheduler, I am receiving an error stating insufficient permissions. Other than these two problems, the reports will run and output correctly. I checked the report manager, but I could not find anything obvious. Does anyone have any information regarding this problem? Thanks! Error: Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'NT AUTHORITY\NETWORK SERVICE' are insufficient for performing this operation. Exception Details: System.Web.Services.Protocols.Soa...

error event id 8331
hi, any body can help solve the error (id 8331) with my exchange server (windows SBS) event id: 8331 description: (The service threw an unexpected exception which was caught at f:\titanium\dsa\src\lra\abv_dg\lservagent.cpp(4511) ) zuhair Users do not appear in the Global Address List, users cannot connect to their Exchange mailboxes, event ID 8331 is logged, and e-mail names cannot be resolved in Exchange Server 2003 http://support.microsoft.com/default.aspx?scid=kb;en-us;837444 Does this apply to you? -- - David Aschmann MCSE: Messaging, Security+ "zuhair" wrote: >...

Opening Report Manager from anything besides localhost gives error
I've never noticed this before, but if I try to go to http:\\crmserver\ReportManager I get a 403.6 error: "Forbidden: IP address of the client has been rejected". However, http:\\localhost\ReportManager works when I'm on the server. My Crystal Reports SW works fine, and once I'm in Report Manager it appears to work fine. What did i do wrong? ...

Publisher 2000/Frontapge 2000
I have completed a clean installation of Win XP (complete with all updates to date). I have then installed parts of MS Office 2000 - Photodraw, Publisher and Frontpage - not included in MS Office 2003 Standard, together with any related office updates. I then installed MS Office 2003 Standard. Finally, I created user accounts with limited access for the kids. All parts of Office 2003, Publisher 2000 and Frontpage 2000 work fine in the administrator account. However, in the limited user account the system attempts to reinstall the software whenever I try to start Publisher or Fron...

Great Plains 7.5 Inventory Reconcile error
When I try to reconcile inventory, I receive the message"you cannot complete this process while invoices are being posted" even though there is nothing posting or needs to be posted. Thank you. The system thinks that someone is posting. Check for stuck batches in Batch Recovery. Get everyone out of the application and restart SQL. -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com "dbloshuk@hotmail.com" wrote: > When I try to ...

Simple OnLoad Code is Giving an Error
I have the following code in my OnLoad event of the Case form. I basically want to disable the description field if there is data in it so it cannot be changed. If (crmForm.all.description.DataValue != null) { crmForm.all.description.Disabled = true; } I am getting an error on form load that says: "There was an error with this field's customized event. Field:window; Event:onload; Error:Object expected." Any ideas on how to resolve? Thanks. On 26.08.2009 19:24, LYFZGUD wrote: > I have the following code in my OnLoad event of the Case form. I > basically want to di...

Outlook 2003 RPC Config error
Has anybody seen this error using Outlook 2003 & Exchange2k? "A system component, RPC, required by Outlook to connect to the e-mail server is not configured properly. For more information, contact your system administrator." This is occuring on a single PC (right now), with serveral other PCs working without a hitch (also using O2k3.) We have not noticed any other problems with this PC. Paul Never mind. I found the answer by modifying my search of this newsgroup. Thanks. Paul >-----Original Message----- >Has anybody seen this error using Outlook 2003 & &...

Adding Attributes
From CRM Deployment Manager, I'm adding custom Attributes, and now I get an error. I have already added a number of custom attributes, and never had this error before. I'm wondering if I've bumped up against the 8000- character-record-limit issue I've read about in this forum. The error message just says you can't add the Attribute, and to check the event log for more info. Can anyone inform me as to how I check out this event log? Thanks, Ian start -> programs -> administrative tools -> event viewe Application Log filter by source Microsoft CR that s...