If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Ambiguous Name Error
I am getting "Ambiguous name Detected" error for a command that no longer
exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- pm |
#2
|
|||
|
|||
You have two copies of Private Sub Update_Retail_Click(). Delete the lines
as indicated below (via a 'X') "pm" wrote in message ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ X Private Sub Update_Retail_Click() X On Error GoTo Err_Update_Retail_Click X X Dim stDocName As String X X stDocName = "Last Retail ID" X DoCmd.OpenQuery stDocName, acNormal, acEdit X X Exit_Update_Retail_Click: X Exit Sub X X Err_Update_Retail_Click: X MsgBox Err.Description X Resume Exit_Update_Retail_Click X X End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- Joan Wild Microsoft Access MVP |
#3
|
|||
|
|||
You've got two separate routines named Update_Retail_Click in what you
pasted. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "pm" wrote in message ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- pm |
#4
|
|||
|
|||
Joan and Doug have already pointed out the problem, but
in case you are interested, here are some KB articles explaining the issue: You receive an "Ambiguous name detected" error message while running a procedure in Access 2000 or in Access 2003: http://support.microsoft.com/?id=817411 ACC97: http://support.microsoft.com/?id=815284 -- Jeff Conrad Access Junkie Bend, Oregon "pm" wrote in message: ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- pm |
#5
|
|||
|
|||
THANK-YOU!! Will try it right away.
"pm" wrote: I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- pm |
#6
|
|||
|
|||
Oops...posted reply in wrong place. THANKS!
"Joan Wild" wrote: You have two copies of Private Sub Update_Retail_Click(). Delete the lines as indicated below (via a 'X') "pm" wrote in message ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ X Private Sub Update_Retail_Click() X On Error GoTo Err_Update_Retail_Click X X Dim stDocName As String X X stDocName = "Last Retail ID" X DoCmd.OpenQuery stDocName, acNormal, acEdit X X Exit_Update_Retail_Click: X Exit Sub X X Err_Update_Retail_Click: X MsgBox Err.Description X Resume Exit_Update_Retail_Click X X End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- Joan Wild Microsoft Access MVP |
#7
|
|||
|
|||
This is how it appears in the module window. I have no clue why there are
two, but I was trying various steps to update the lists in two list boxes on the form after adding a new contact ID as a result of "NotInList". In a new record, I wanted to see the last ID number I had just assigned - and I don't know if I have that figured out or not, but at this point may just leave it well enough alone to get the rest of these records entered. Thanks for your prompt response. "Douglas J. Steele" wrote: You've got two separate routines named Update_Retail_Click in what you pasted. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "pm" wrote in message ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- pm |
#8
|
|||
|
|||
Thank-you, I will check it out.
Another question...my version is Access 97, but I have found it does not vary much from newer versions. I have been thinking about upgrading, but don't care for the menus in newer versions of Office. Are there some more efficient, effective tools in newer Access versions? I'm a "learn-as-you-go" user. "Jeff Conrad" wrote: Joan and Doug have already pointed out the problem, but in case you are interested, here are some KB articles explaining the issue: You receive an "Ambiguous name detected" error message while running a procedure in Access 2000 or in Access 2003: http://support.microsoft.com/?id=817411 ACC97: http://support.microsoft.com/?id=815284 -- Jeff Conrad Access Junkie Bend, Oregon "pm" wrote in message: ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- pm |
#9
|
|||
|
|||
Oh, by the way...I don't have any commands or macros entitled
"Update_Retail", nor any similar for "Distr". This all started because I wanted to refresh the list box entries and see the most recent contact ID. I would be happy now if I can just get these records entered. Shall I take out all these "Update" references? "Joan Wild" wrote: You have two copies of Private Sub Update_Retail_Click(). Delete the lines as indicated below (via a 'X') "pm" wrote in message ... I am getting "Ambiguous name Detected" error for a command that no longer exists on my form. The following is a copy of what is in the module behind the form, but I don't know what to take out or leave in. ------------------------------ X Private Sub Update_Retail_Click() X On Error GoTo Err_Update_Retail_Click X X Dim stDocName As String X X stDocName = "Last Retail ID" X DoCmd.OpenQuery stDocName, acNormal, acEdit X X Exit_Update_Retail_Click: X Exit Sub X X Err_Update_Retail_Click: X MsgBox Err.Description X Resume Exit_Update_Retail_Click X X End Sub Private Sub Update_Retail_Click() On Error GoTo Err_Update_Retail_Click Dim stDocName As String stDocName = "Last Retail ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Retail_Click: Exit Sub Err_Update_Retail_Click: MsgBox Err.Description Resume Exit_Update_Retail_Click End Sub Private Sub Update_Distr_Click() On Error GoTo Err_Update_Distr_Click Dim stDocName As String stDocName = "Last Distr ID" DoCmd.OpenQuery stDocName, acNormal, acEdit Exit_Update_Distr_Click: Exit Sub Err_Update_Distr_Click: MsgBox Err.Description Resume Exit_Update_Distr_Click End Sub ----------------------- Would appreciated simple steps to resolve this. I have to finish a project TODAY and need help ASAP! -- Joan Wild Microsoft Access MVP |
#10
|
|||
|
|||
"pm" wrote in message:
... Thank-you, I will check it out. Another question...my version is Access 97, but I have found it does not vary much from newer versions. I have been thinking about upgrading, but don't care for the menus in newer versions of Office. Are there some more efficient, effective tools in newer Access versions? Hi, This link details some of the new features in Access 2003: How to use the new features and the new enhancements that are in Office Access 2003: http://support.microsoft.com/?id=823089 Also, here is a fabulous post by MVP John Viescas on this very subject. Incidentally, he has a book out on Access 2003 so he really knows what he is talking about. Here it is: They didn't make any major changes. Here's a summary: View information on object dependencies In Microsoft Office Access 2003, you can view information on dependencies between database objects. Viewing a list of objects that use a specific object helps maintain a database over time and avoid errors related to missing record sources. For example, the Quarterly Orders query in the Sales database is no longer needed, but before deleting it, you might want to find out which other objects in the database use the query. Then, you could either change the record source of the dependent objects, or delete them, before deleting the Quarterly Orders query. Viewing a complete list of dependent objects helps you save time and minimize errors. In addition to viewing the list of objects that are bound to a selected object, you can also view the objects that are being used by the selected object. Macros, modules, and data access pages are not searched for dependencies. Access projects do not support this feature. Error checking in forms and reports In Microsoft Office Access 2003, you can enable automatic error checking for common errors in forms and reports. Error checking points out errors, such as two controls using the same keyboard shortcut, and the width of a report being greater than the page it will be printed on. Enabling error checking helps you identify errors and correct them. Propagating field properties In previous versions of Microsoft Access, whenever you modified a field's inherited property, you had to manually modify the property of the corresponding control in each of the forms and reports. Now, when you modify an inherited field property in Table design view, Access displays an option to update the property of all or some controls that are bound to the field. Smart tags In Microsoft Office Access 2003, you can use the SmartTags property to add a smart tag to any field in a table, query, form, report, or data access page in a database. Back up a database or project You can back up the current database or project before making major changes to it. The backup will be saved in the default backup location, or in the current folder. To restore a database, go to the location of the backup, rename the file, and open it in Access. Windows XP theme support The Microsoft Windows XP operating system offers you several themes. If you have chosen a theme other than the default, Access will apply the chosen theme to views, dialog boxes, and controls. You can prevent form controls from inheriting themes from the operating system by setting an option on the database or project. Improved sorting in controls You can now specify the ascending or descending sort order of up to four fields in the List Box and Combo Box Wizards in forms and reports, and the Lookup Wizard in an Access database. The sort page added to these wizards looks and behaves like the sort page in the Report Wizard. Autocorrect options In Microsoft Office Access 2003, you have more control over the behavior of the AutoCorrect feature. The AutoCorrect Options button appears near text that was automatically corrected. If you find on occasion that you don't want text to be corrected, you can undo a correction or turn AutoCorrect options on or off by clicking the button and making a selection. Enhanced font capabilities in SQL views In the SQL and query Design views of a query in both a Microsoft Access database and Microsoft Access project, you can now change the font and font size of the text by using the Query design font option added to the Tables/Queries tab of the Options dialog box under the Tools menu. These settings apply to all databases and work with the high-contrast and other accessibility settings of your computer. Context-based Help in SQL view In the SQL view of a query in a Microsoft Access database, you can now get help specific to Jet SQL keywords, VBA functions, and Access functions. Simply press F1 to bring up the help that corresponds to the text near the cursor. You can also search the Jet SQL and VBA function reference topics. Importing, exporting, and linking Importing, exporting, and linking to a Microsoft Windows SharePoint Services list from Access You can perform the following operations with a Windows SharePoint Services list: ?Export the contents of a table or a query to a list. ?Import the contents of a list into a table. ?Link a table to a list. Exporting and linking to Access data from Windows SharePoint Services You can now export a list in its Datasheet view from Windows SharePoint Services to a static table or to a linked table in Access. When you export to a static table, you create a table in Access. You can then view and make changes to the table independent of the original list in Windows SharePoint Services. Similarly, you can change the list in Windows SharePoint Services, and that will not affect the table in Access. When you export to a linked table, you create a table in Access and establish a dynamic link between the table and the list such that changes to the table are reflected in the list, and changes to the list are reflected in the table as well. Make a local table from a linked table In Microsoft Office Access 2003, you can make a local copy of the structure or data and structure contained in a linked table. XML support With the enhanced XML support in Microsoft Office Access 2003, you can specify a transform file when you import data from or export data to XML. The transform is then applied automatically. When you import XML data, the transform is applied to the data as soon as the data is imported, before any new table is created or an existing one is appended to. When you export data to XML, the transform is applied following the export operation. Often times a database contains lookup values that are stored in another database. You can now include these related tables when exporting. You can also include any predefined filter or sort order for an object when exporting the object. Security enhancements Macro Security Microsoft Office Access 2003 allows you to protect against potentially unsafe Visual Basic for Applications (VBA) code by setting the macro security level. You can set the security level so that you are prompted every time that you open a database containing VBA code, or you can automatically block databases that are from unknown sources. Additionally, Access uses Microsoft Authenticode technology to enable you to digitally sign a macro project by using a digital certificate. The certificate used to create this signature confirms that the macro originated from the signer, and the signature confirms that it has not been altered. When you set the macro security level, you can run macros based on whether they are digitally signed by a developer on your list of trusted sources. Block Potentially Unsafe Functions Access utilizes the Microsoft Jet Expression Service enhanced sandbox mode to block potentially unsafe functions from being used in expressions. ------ The last one is a real pain. You need to install JET SP8 from Windows Update (not included with Office 2003) to get this to work properly. I suspect most folks will change their macro security setting to Low to avoid the security prompts. HTH... -- John Viescas, author "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ (Microsoft Access MVP since 1993) And here is some information posted by MVP Allen Browne: Benefits of Access 2003: 1. *Every* time you open your database in Access 2003, you are presented with a series of dialog boxes that advise you not to use your program, because it may be unsafe. There are 3 or 4 dialogs, some that you have to scroll to read all the text, and find the question you are actually answering. If you accept the default answer in any of these dialogs, you are thrown back out, i.e. your file does not open. The recommended solution is for your company to shell out money buying a digital certificate to let you open your own database, and of course you have to keep buying the certificate every year. If you are an individual you cannot get a certificte. If you make even minor changes to your database (such as changing an action query), you must go through the process of signing it again, and there several related problems with constantly changing a signed database. The not-recommended solution is to set the Macro Security to Low, so Access 2003 behaves like Access should and like the previous versions do that do not have this problem. (You can also avoid some of the dialogs by sacrificing functionality.) 2. Access 2003 will not run on Windows 98 or ME. (All previous versions do.) 3. Access 2003 contains nearly all the bugs that are in previous versions, including sorting failures, comparison failures, lots of problems with filters in forms and reports, corruptions caused by Name AutoCorrect, and so on. More details: http://allenbrowne.com/tips.html#flaws 4. A2003 contains new bugs and quirks, such as themed controls, incompatibility with the way subform controls were referenced in previous versions, problems with network printers, ... 5. The new features in A2003 generally don't work as advertised. For example, it promises that it can track object dependencies, but to do that requires Name AutoCorrect to be turned on. My last attempt to work with this (in a database that had queries into tables that no longer existed) caused at least 8 crashes (A2003 shut down by Windows) in one hour (with repairs and restarts in between), so IME it is completely unusable. 6. Once you know all the bugs and how to configure A2003, it is actually possible to get a setup that crashes less often during development then A2000 and A2002. 7. It is easier to find things in the Help File in A2003. -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. Hope that helps to answer your question. -- Jeff Conrad Access Junkie Bend, Oregon |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Backing Database | GOL | General Discussion | 4 | January 28th, 2005 03:32 PM |
Error message different in MDB and MDE | david epsom dot com dot au | General Discussion | 1 | September 21st, 2004 12:47 AM |
Help, i'm gettiing error: Access has encountered a problem and needs to close... | betsy | General Discussion | 0 | September 14th, 2004 08:20 PM |
Expression - calculating running total | Kathy | Running & Setting Up Queries | 26 | June 22nd, 2004 10:14 PM |
Custom Error Messages | DMc2004 | Database Design | 4 | June 11th, 2004 11:16 PM |