duplication problem

bone head

Registered User.
Local time
Today, 23:11
Joined
Feb 11, 2002
Messages
73
Hi

I have a form which has a button on it which when pressed e-mails a report to relevant people.

Small problem I set it up to act when clicked once, however now the system is in operation it would seem that some people through habbit double click, thus sending the report twice, I have nothing set in the double click option

I am asssuming that it is the double clicking which is creating the duplication.

How is the best way to prevent any suggestions, I would think I need to disable the double click somehow but do not know how to do this.

Many thanks in advance
 
Put a Msgbox after your code saying "Message sent". That way the focus will be diverted so the button wont fire again.
Dave
 
Probably the easiest thing to do is run the code on a double click event rather than single. So in the code for the button use cmdWhatever_DblClick rather than cmdWhatever_Click - simply replace it. Then in Properties for the button under 'Event' make sure the event procedure is for double click not click.
HTH
 
Thanks for the advise i do however already have a message box which comes up after the email has been sent.

you do however have to click send to send the email when outlook opens, the message box appears after this.

the idea of setting the code for double click worries me in that then if someone only clicked once it would not be sent. and if they were not familiar with the system would not be aware.

Any further suggestions.
 
right had an idea based on oldsoftboss's suggestion i have put an additional message box in prior to opening the email saying "opening e-mail editor" it seems to work i have tried double clicking and only getting the email sent to me once.

it seems to be working then however i am aware this is probably not the best way to do it, but what the heck if it works !!

I am concious of the fact however that at some time in the future someone may want to try to work on my data base, so i try to avoid doing what may not be the correct things if possible.

so if there is a more obvious way of acheiving what i want would be gratful
 
Why not ask the user if they want to send the email? Use this If message box question so that user
has to answer Yes or No if they want to send the email.

Code:
    If MsgBox("Do you want to send the email?", vbQuestion + vbYesNo, "Email Question") = vbYes Then
        'your code here to send the email
    Else
        MsgBox "Email function was aborted per your request.", vbOKOnly, "No Email"
    End If
HTH
 
Thanks but it is not really an option in this case.

what the report is, is notification that something has been entered onto the database which requires their attention, so i do not really want it as optional

usefull bit of code though have filed it for other uses.

Many thanks

BH
 
The Msgbox at the start of the code say "About to send" or something was my next suggestion.
Glad you worked it out
Dave
 
oldsoftboss you are begining to confuse me again, your origional post reffered to a message box at the end of the code, which i replied saying i already had, i then put another message box at the begining of the code and this seems to work.

So end result i now have 2 message boxes one which says starting e-mail and one at the end saying sending e-mail, this does sounds cumbersome to me, but what the heck it seems to work, and gives the user something to watch.
 

Users who are viewing this thread

Back
Top Bottom