Button Change

expublish

Registered User.
Local time
Today, 11:26
Joined
Feb 22, 2002
Messages
121
I have a form where the user types out an email message and clicks the send button to send it.

I want to make it so that when they have clicked the button, it becomes unclickable for a second time. This stops them sending the message by more than one time accidentally. It needs to bedisabled and also the writing changed from 'Send' to 'Sending ...'.

Anyone done this? I can't find anything in the search facility.
 
Try

Your previous command
Me.Email.Caption = "Sending"
DoCmd.GoToControl "differentcontrolName"
Me.Email.Enabled = False

Although you will probably find it won't continue to these commands until the previous one is complete which may not be the desired effect. You could try moving the code around until is suites
 
I am a little confused.

The first and last lines seem simple, but:

DoCmd.GoToControl "differentcontrolName"

What control goes here?

My current code looks like this:

Code:
Private Sub Command0_Click()
On Error Resume Next
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("email list")
Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("E-mail").Value
DoCmd.SendObject , , , strEmail, , , _
Me.subject, Me.message, False
rsEmail.MoveNext
Loop
Set rsEmail = Nothing

'change style of button here

Dim intPrompt As Integer
intPrompt = MsgBox("Messages Sent" & vbCrLf & vbCrLf_ & "Press OK to continue", vbOKOnly, "Email Confirmation")
DoCmd.Close acForm, "email"

End Sub

Any help as I am puzzled!
 
You can not disable a control while it has the focus, therefore You need to move the focus to a different control on your form i.e.Command1 if you have a button named this.
 

Users who are viewing this thread

Back
Top Bottom