473,320 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Menu Button Error Woes

Access has me flummoxed again (nothing new in that). I added menu buttons to
a form using the command button wizard on the tool bar. They worked fine.
You can see the "onclick" event under "Dipslide Add Record" below.

Then when I went to a second form, accessing a different table, and tried to
add the same button all I got was an error message to the screen. I did
exactly the same thing, used the command button on the tool bar, for exactly
the same purpose for the button but the onclick event is shown below under
"Inventory Add Record." I have gone in and out of the programme, reset the
button but still get the same error to the screen when I click on it.

The error reads: "The expression On Click you entered as the event property
setting produced the following error: Ambiguous name detected:
SaveInventoryRecord_Click. *The expression may not result in the name of a
macro,the name of a user defined function, or [Event Procedure].*There may
have been an error evaluating the function, event or macro.)

Help would be appreciated. Thank you.

*******************************
Dipslide Add Record:
*******************************
(Button name "New Record Button.")

Private Sub NewRecordButton_Click()
On Error GoTo Err_NewRecordButton_Click
DoCmd.GoToRecord , , acNewRec

Exit_NewRecordButton_Click:
Exit Sub

Err_NewRecordButton_Click:
MsgBox Err.Description
Resume Exit_NewRecordButton_Click

End Sub

********************************
Inventory Add Record:
********************************
(Button name "Add Record.")

Err_Command219_Click:
MsgBox Err.Description
Resume Exit_Command219_Click

End Sub
Private Sub AddRecord_Click()
On Error GoTo Err_AddRecord_Click
DoCmd.GoToRecord , , acNewRec

Exit_AddRecord_Click:
Exit Sub

Err_AddRecord_Click:
MsgBox Err.Description
Resume Exit_AddRecord_Click

End Sub
Nov 12 '05 #1
1 2661
William, I too have spent a lot of time trying to debug a similar
problem before finding a fix. In the newsgroups you will find people
saying that the answer is that there are two events defined with the
same name; and that if you go into your code section and look for it,
you will find it. This is not true in all cases. This error can also
be caused by a confusing form property. If you look at your form
properties, you will find a property called "has module." In some
cases – while creating events for controls using the [event tab] –
access will ask you to enable the "has module" property by changing it
to ‘Yes.' If you go and do this, occasionally Access gets confused
and creates another code module for the form that you cannot see. I
have not found any way to get to the other module. Because the other
module contains duplicate ‘event declarations,' Access cannot
determine which routine you are referring to. You will have to change
this value to ‘No' and then allow the changes to be saved. Next, one
of two things will happen. You will have to close the database and
then re-load it. After this, the "has module" property will be
automatically set back to ‘Yes,' or you have to set it back manually.
This should get rid of the hidden ‘code module.' This has worked for
me several times, so I thought I'd better post it.
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be...
3
by: Robert Megee | last post by:
I've been able to essentially disable the back button on IE6 by expiring the cache. I would like to do the same for the browser that runs on pocketPC. I believe it is IE4. However this technique...
3
by: John | last post by:
Hi there, I was reading an article (http://avenuea-razorfish.com/articles/TheAll-MenuNavigation_Turbek.pdf) on 'all-menu navigation' and I'd like to try and implement this in my site. Can...
2
by: Ravi Joshi | last post by:
The menu on my site works fine in IE6 and Firefox. In IE7, there is a problem with the menu: when you mouse over the various main catagories, the sub-catagories all appear to the right as they...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.