UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Msgbox Fires Twice, Access 2013    
 
   
SemiAuto40
post Jun 19 2019, 12:29 PM
Post#1



Posts: 695
Joined: 3-April 12
From: L.A. (lower Alabama)


I have a check of a record set and...... If the RS_Search.BOF And RS_Search.EOF Then -> open a message box and tell me about it. So..... the message box fires twice in a row each pausing for the OK to be clicked. When I use the debugger or place a stop at the end of the code block the message box only fires once!? The only thing I can figure is the delay of the breakpoint at the end causes the message box and code to behave properly. I have checked and the code block is not getting run through twice thereby throwing the message twice.

Any suggestions how to cause Access to do right, or why it is doing this? This is on a search form and will be used frequently... so I can't have users finding no match to get this freakin message twice in a row to click through.

Thanks.
Go to the top of the page
 
theDBguy
post Jun 19 2019, 12:31 PM
Post#2


Access Wiki and Forums Moderator
Posts: 75,720
Joined: 19-June 07
From: SunnySandyEggo


Hi. We can start by looking at the code in question. Can you post it please? Thanks.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
SemiAuto40
post Jun 19 2019, 01:27 PM
Post#3



Posts: 695
Joined: 3-April 12
From: L.A. (lower Alabama)


The code is on a btn_Search_Click()... surely nothing normal behaving could simply have a breakpoint at the end of the code block in order for this misbehavior to be corrected. The breakpoint only paused the code - but what I just found to fix it - was to direct focus away from the btn_Search to a btn_ClearSearch. The focus seemed to be staying on the btn_Search and quickly after the msgbox was responded to - go back on to the btn_Search again.... which I guess Access interpreted as another button click of the btn_Search. Does this make sense?
Go to the top of the page
 
theDBguy
post Jun 19 2019, 01:49 PM
Post#4


Access Wiki and Forums Moderator
Posts: 75,720
Joined: 19-June 07
From: SunnySandyEggo


Sadly, no, it doesn't make sense to me.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
ITguaranteed
post Jun 19 2019, 06:59 PM
Post#5



Posts: 29
Joined: 19-June 19
From: Tasmania, Australia


In this instance can I suggest using lots of debug.print statements instead of debug mode, like every other line and view the results through the intermediate window to see what happens at completion of the code.

But as theDBguy suggests above, please post your code.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    18th July 2019 - 04:26 PM