?
Solved

ERROR OCCURS WHEN DOUBLE CLICK ON A BUTTON

Posted on 2003-03-10
12
Medium Priority
?
144 Views
Last Modified: 2010-05-01
I have a question here. I am using asp to display a crystal report. I have a combo box, which after selected, i need to press on a "GO" button, then the results will be displayed.

The error occurs if I double clicked on the "GO" button because my button is just _Click. Is it possible to solve this problem?

Thanks.
0
Comment
Question by:huiqun
  • 4
  • 2
  • 2
  • +4
12 Comments
 

Expert Comment

by:mirghani
ID: 8101509
what error u r getting?
Meer.
0
 
LVL 11

Expert Comment

by:rdrunner
ID: 8101681
Disable the button in the button click event

private sub command1_click
command1.enabeled = false

'Work here

command1.enabeled = true
end sub

0
 
LVL 11

Accepted Solution

by:
rdrunner earned 2000 total points
ID: 8101689
Damn spelling ;)

Private Sub Command1_Click()
Command1.Enabled = False
'Work here
'Work even more
Command1.Enabled = True
End Sub

I am used to type only "en^[space]" ;)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:rdrunner
ID: 8101701
P.p.s: If you  dont want to disable the button you can use a static variable

Private Sub Command1_Click()
static isWorking as boolean
if not isworking then
isworking = true
'Work here
'Work even more
isworking = false
end if
End Sub
0
 
LVL 11

Expert Comment

by:supunr
ID: 8102118
private Command1Clicked as boolean.

Private sub Command1_Click()
    On Error goto Command1Err
    if (Command1Clicked) then  Exit sub

    Command1Clicked = true

    ' do all work here
    ' e.g. call other functions, etc.

    Command1Clicked = false
    Exit sub

Command1Err:
    Command1Clicked = false  
    On error goto 0
End if

Good Luck!
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 8102954
rdrunner gave you the correct answer there.  supunr has essentially copied one of the solutions posted above.
0
 
LVL 11

Expert Comment

by:rdrunner
ID: 8103010
Thanx Paul ;)
0
 
LVL 4

Expert Comment

by:iozturk
ID: 8103046
Since its in asp consider this that works for disabling after one click. You may need some changes.

<Script>
  function validate() {
    form1.OK.disabled=true;
     
  }
</Script>

<form name=form1 action="yourasp.asp">

<input type="submit" name="OK" value="OK" onclick="return(validate(this))">
</form>

0
 

Expert Comment

by:CleanupPing
ID: 8900416
huiqun:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 8907056
points to rdrunner
0
 

Expert Comment

by:CleanupPing
ID: 9056488
huiqun:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9074606
Moderator, my recommended disposition is:

    Accept rdrunner's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question