?
Solved

ERROR OCCURS WHEN DOUBLE CLICK ON A BUTTON

Posted on 2003-03-10
12
Medium Priority
?
143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 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