Command Buttons Not Responding on First Click

Using Access 2003.

Very simple, I have a command button to close the form.  Code is as
follows (form is called "Select212Form")

Private Sub btnMenu_Click()
On Error GoTo Err_btnMenu_Click

    DoCmd.Close acForm, "Select212Form"

Exit_btnMenu_Click:
    Exit Sub

Err_btnMenu_Click:
    MsgBox Err.Description
    Resume Exit_btnMenu_Click

End Sub

The button does nothing the first time it's clicked.  Next time, I
click it, it works!  It's not a double-click, there is a pause between
clicks.  If I put a breakpoint in there, it enters the routine on the
first click and closes the form as it should.  Anyone every seen this?

0
thomas
10/17/2007 7:22:42 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
1170 Views

Similar Articles

[PageSpeed] 39

Is it possible that the form could have unsaved edits that are effecting 
things here?

Try replacing:
    DoCmd.Close acForm, "Select212Form"
with:
    Debug.Print Now() & " - attempting to close " & Me.Name
    If Me.Dirty Then Me.Dirty = False
    DoCmd.Close acForm, Me.Name

If that works, you can remove the Debug.Print line.

-- 
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.

<thomas.b.mann@gmail.com> wrote in message 
news:1192648962.158260.268240@i38g2000prf.googlegroups.com...
> Using Access 2003.
>
> Very simple, I have a command button to close the form.  Code is as
> follows (form is called "Select212Form")
>
> Private Sub btnMenu_Click()
> On Error GoTo Err_btnMenu_Click
>
>    DoCmd.Close acForm, "Select212Form"
>
> Exit_btnMenu_Click:
>    Exit Sub
>
> Err_btnMenu_Click:
>    MsgBox Err.Description
>    Resume Exit_btnMenu_Click
>
> End Sub
>
> The button does nothing the first time it's clicked.  Next time, I
> click it, it works!  It's not a double-click, there is a pause between
> clicks.  If I put a breakpoint in there, it enters the routine on the
> first click and closes the form as it should.  Anyone every seen this? 

0
Allen
10/18/2007 6:20:09 AM
I have tried both of those things:

if me.dirty then me.dirty=false

as well as using Me.Name as opposed to "Select212Form"

This form is not even data bound.

However, when I just change the code to simply say:

DoCmd.Close

it seems to work just fine!!


0
thomas
10/18/2007 6:32:06 PM
Reply:

Similar Artilces:

save button
I have created a new form in the opportunity detail form with a link in the Detail Form Navigation Panel. This new form permit to insert or update some new opportunity customized fields. I would save this data from form to CRM reusing the "save" button of the opportunity detail form without insert a new button in my new form. How can I do that? Thanks. Mauros, In your new form, make a JS call: window.opener.crmForm.SubmitCrmForm(1,true,true,false) To make sure that you only call this when you want to (for example if the user just closes the view or clicks cancel, you ma...

the "modify selection" button is never highlighted
I have a macro (I wrote) that is listed with the project name (and the project name appears on my button) and despite following (what I believe are) the instructions for renaming it the "Modify Selection" button in the Tools.Customize.Commands dialog box is never enabled and I can't rename it. It's Outlook 2000 if that matters. What's ironic is all the messages that I can find with a search that outline how simple it is to make the change by just pressing that button. Something is up :-) Thanks, Tom ...

Disabling right click in access 2003
please get me help on how to disable the right click action of mouse on access 2003 forms progrmatically. -- Skumar no need, just set the form property ShortCut menu = no HTH Pieter "Sreekumar" <Sreekumar@discussions.microsoft.com> wrote in message news:9C821170-22B9-4801-9E8D-5A5A4D84F34B@microsoft.com... > please get me help on how to disable the right click action of mouse on > access 2003 forms progrmatically. > -- > Skumar This is what I looked for. Thanks Mr. Peter Wijnen. -- Skumar "Pieter Wijnen" wrote: > no need, just set the fo...

Outlook 2003 buttons don't work anymore
I have outlook 2003, and recently two buttons stopped working. First, if I click "Send/Receive", nothing happens. Second, I cannot change the account with which to send my email anymore. If I click on "account" when composing an email, outlook runs into problems. Any idea about what's going on? thanks. Find and delete the SRS file for your profile. see http://www.outlook-tips.net/beginner/filepath.htm for the file location. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick....

Create a sequence when the first cell has text and numbers
This might be a silly question, but I haven't been able to find the answer. I have one cell that will always have the the following format: ABCD1111111111111111 (4 letters and 16 numbers). That will be my first cell, I want to be able to create that number plus 1 on the cell below, and repeat (scroll down) as many rows as there is information on the left column. I t can be either using a formula or a macro: A B 1 Apples ABCD0000000000000005 2 Oranges ABCD0000000000000006 3 Pears ABCD0000000000000007 4 Coconut ABCD0000000000000008 I tried Autofill but it doesn't work, ...

Windows Office 2000 installer tries to execute everytime I compose or respond to a message
In OWA, Every time I try to compose or respond to a message, the Windows Office 2000 installer tries to execute and asks for the CD. Unfortunately, this Office 2000 problem has come up again even after all the updates to Office 2000. Also I am having trouble logging out. When I hit the logoff button, it brings up a sign-in screen asking for ID & password again. Whether I cancel it or fill it in and type OK, it then gives me a screen that says "access denied". I never get a screen which says that logout was successful. I have the same problem here... From what I've s...

Auto first letter of sentence uppercase
I've been asked to create a list of program files and as you know they will all have a period and extension. The problem is, How do you turn off the auto uppercase first letter of the file when typing the list. We all like google, me too! And I'd like to lessen any burden but I don't know how to ask it in the google box. I've got about a thousand files to type. Question is, will I loose my sanity or run out of martinis first?<G> -- Don Vancouver, USA Your sanity will be loose after the first martini. You could try searching for leading caps. Are you going to use P...

Move Track in CRM button away from Send button
Users are accidentally promoting personal emails in CRM because the Track in CRM button is so close to the Send button. Need to be able to move it to another location. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Communit...

mail button in Outlook 2003
When I click on the mail button I get a run time error that says class not registered. I just got this computer and I am trying to use outlook but I will not be using the email feature. ...

Msn-Encarta right-click dictionary query
Understand this freeware feature by msn-encarta has been discontinued from online after running for a few years. Appreciate if someone might know and advise, if it, (or it's equivalent), is available anywhere else. TIA. franktee "franktee" <franktee@discussions.microsoft.com> wrote in message news:E4D26788-F53B-4C72-B08F-CCE273E1F82B@microsoft.com... > Understand this freeware feature by msn-encarta has been discontinued > from > online after running for a few years. > Appreciate if someone might know and advise, if it, (or it's > equiva...

Microsoft outlook (not responding) #2
Hi = can anyone help. I can't get in to Microsoft Office Outlook. It opens but 'freezes' after about two second so I can't download messages or open any existing messages? Thanks when that happens to me I bring up task manager (ctl-alt- del) and almost always find that a second Outlook is still running. You won;t see it under applications, but you will see it under processes. you must end the process tree for the one that is still running. I don;t know why this happens. >-----Original Message----- >Hi = can anyone help. I can't get in to Microsoft Office &g...

cant respond to you dick watson
im new to this newsgroup thing...im trying to respond to your question about cash flow and trended items...yes, i have that box unchecked but also can't check the box that allows me to use my advanced budget for cash flow forecasting because its greyed out... ...

Where is the viewing datasheet button?
and what is your definition of "viewing datasheet"? -- Don Guillett SalesAid Software donaldb@281.com "Sam" <Sam@discussions.microsoft.com> wrote in message news:5A98FC88-653C-4D29-BDBB-4F01124D8599@microsoft.com... > I was looking for the button to click on to view the datasheet information. Only after did I find that the datasheet information was on the worksheet below. Sorry to have bothered you. "Sam" wrote: > ...

Protecting choice buttons
I've created these great choice buttons but now I want to lock them so users can't accidentally delete/move/edit them. If I lock and protect them, nobody can click on them. Any suggestions? Thanks, TW Maybe just protecting the objects would be sufficient: Something like this in code: ActiveSheet.Protect DrawingObjects:=True, Contents:=False, Scenarios:=True MNR Lady wrote: > > I've created these great choice buttons but now I want to lock them so users can't accidentally delete/move/edit them. If I lock and protect them, nobody can click on them. Any suggestions? ...

OL-XP
My friend has an URL in an email to a .swf file on the internet. When she clicks on the link, a dialog box comes up saying: Locate Link browser in the title bar. File name is blank Files of type shows "Executable files" I am guessing it has something to do with IE. She had AOL on the PC and uninstalled it. We made sure IE is set as the default browser but that didn't remedy the situation. Is there a reg file that will reset this or do we just need to locate ieplore.exe and choose that as the file to run? Thanks for any help. �� <news@kidsnews.au.org> wrote: > My fri...

Why are some commands in Excel's Drawing Toolbar greyed-out (eg T.
I simply want to add a Text Box to an Excel Chart. Although I can open the Drawing Toolbar OK, some comands on it are greyed-out and do not function? How can I activate the Text Box command? By the way, if I create a new spreadsheet, all the Drawing Toolbar commands are active. So I conclude that the problem lies with the specific spreadsheet that I am working on rather than the software or any general settings. It seems so basic, but I would really appreciate help on how to fix it. Thanks. Hi any chance the file is either protected, shared or has grouped sheets? -- Regards Frank Kabel...

2007
Trying to accept a new subscription to a calendar. I have no accept button and the directions to Add Net Folder feature dont work. Cant locate that feature as it instructs. I'm unclear about what you're trying to do or what instructions you're = viewing. Outlook 2000 was the last version to have Net Folders.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/ju...

Triggering system tray app from custom button
Is there a way to trigger a program that's running in the system tray from a custom button? Tom -- The worst words in business: "We''ve always done it that way" -- Stop Fishing for eMail. ...

debugging error when I click on Outlook
Thanks for the reply...Here is the exact error message At the top of dialogue box.. "Microsoft Visual C ++ Debug Library Program C:\Progra~1\Micros~4\Office 10\Outlook.exe Abornormal program termination" Corky >-----Original Message----- >What does the error say? > >Also, the reason you get the debugger is because you have something >installed that can debug it. > >-- >Diane Poremsky [MVP - Outlook] >Author, Teach Yourself Outlook 2003 in 24 Hours >Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) >Author, Google and Other Search E...

Constant execution of ListBox.Click
How do I constantly make events fire, like ListBox.Click subroutine. Currently I can run the result only by executing the macro run button thingie. Cant I make the VBA work all the time without pressing any buttons to run the code? ListBox_Click will run when and only when a different listbox selection is made in this very listbox. That is the whole point of events. If you want sonething to happen all the time then program it to happen all the time, don't use events. HTH. Best wishes Hrald "Curious George" <Jakesama@gmail.com> wrote in message news:3aefc58b-5ff9-46f...

Logo on first page
On a 10 page website, only on IE8, my logo does not appear on the home page but does appear on the other 9. It works fine on Mozilla Firefox, Chrome and Safari and even IE7. Help please, I'm desporate, I've spent many hours to to find my problem and correct it to no avail. Post this on the publisher.webdesign newsgroup. Post your URL and what version Publisher you are using. -- Mary Sauer http://msauer.mvps.org/ "RonB" <rb69_98@hotmail.com> wrote in message news:82e6e22e-8826-4acc-ba3e-8fbe88de258f@m26g2000yqb.googlegroups.com... > On a 10 page we...

Outlook Today Customization Options button not functioning after installing Wind
The Outlook Today Customization Options button not functioning on Outlook 2000 OL2000: You Cannot Customize Outlook Today After You Install Critical Update 813489 for Internet Explorer: http://support.microsoft.com/default.aspx?scid=kb;EN-US;820575 -- Diane Poremsky [MVP - Outlook] http://www.poremsky.com - http://www.cdolive.com Outlook Tips: http://www.outlook-tips.net/ Expert Zone http://www.microsoft.com/windowsxp/expertzone Search for answers: http://groups.google.com Most recent posts to the Outlook newsgroups: http://groups.google.com/groups?as_ugroup=microsoft.public.outlook.*&...

Where is the layer or order command
Can anyone tell me where to find the order and layer commands when trying to group things together into one image or section so they move together? If anyone knew what version of which program you're using I'm sure they would be more than happy to help out. It would also be beneficial to offer a more detailed explanation of what you're trying to do - Grouping is a separate operation from changing the stacking order, and the names & locations of the commands vary a bit from one program/version to another. Regards |:>) Bob Jones [MVP] Office:Mac On 9/7/08 11:10 PM, in ar...

Can I uninstall DPM 2007/2010 client agent using command line inst
Hi All, My protected server is Windows 2008 R2 server core. I cannot use Add/Remove program to uninstall the dpm client agent. Do anyone know if there is command line to uninstall the DPM 2007/2010 client agent? If yes, please advise for the syntax being used. TIA M C You can follow the steps present at: http://technet.microsoft.com/en-us/library/bb870937.aspx Thanks, Praveen D [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights. "M C" <MC@discussions.microsoft.com> wrote in message news:26605179-DB37-4698-8FE...

New shortcut out into the ribbon button
How to Drag a shortcut out into the ribbon button ...