Why Button Control Required to click twice to activate code ?

  • Thread starter edisonl via AccessMonster.com
  • Start date
E

edisonl via AccessMonster.com

Hi,

I have a button control to activate lists of actions to execute.

However I relised that it has to be click twice before it can actually fire
off the instructions _on_Click

anyone got similar experience like to help ?

Regards & God Bless, Edison
 
L

Linq Adams via AccessMonster.com

What exactly is your code (copy and paste here) and where is the button
situated? On a form, subform, etc.
 
E

edisonl via AccessMonster.com

Hi Adam,

Thanks for responding, I insert it in a form:
~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~
Private Sub Confirm_Button_Click()
Dim a As String
On Error GoTo Err_Confirm_Button_Click
' 1 ANNUAL LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
If (Forms!login_form!LeaveType_ComboBox.Value = "AnnualLeave") Then
submitannualleave

' 2 MEDICAL LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "MedicalLeave") Then
submitmedicalleave

' 3 TIME OFF * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "Time-Off") Then
submittimeoff

' 4 CHILD CARE LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "ChildCareLeave") Then
submitchildcareleave

' 5 MATERNITY LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "MaternityLeave") Then
submitmaternityleave

' 6 PATERNITY LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "PaternityLeave") Then
submitpaternityleave

' 7 MARRIAGE LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "MarriageLeave") Then
submitmarriageleave

' 8 UNPAID LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "NoPayLeave") Then
submitunpaidleave

' 9 EXAM LEAVE * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "ExamLeave") Then
submitexamleave

' 10 Reservists * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "Reservists") Then
submitreservists

' 11 Compassionate Leave * * * * * * * * * * * * * * * * * * * * * * * * *
* * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "CompassionateLeave")
Then
submitcompassionateleave

' 12 Hospitalisation Leave * * * * * * * * * * * * * * * * * * * * * * * *
* * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "HospitalisationLeave")
Then
submitHospitalisationleave

' 13 Others * * * * * * * * * * * * * * * * * * * * * * * * * * * *
ElseIf (Forms!login_form!LeaveType_ComboBox.Value = "Others") Then
submitothers

End If

Exit_Confirm_Button_Click:
Exit Sub

Err_Confirm_Button_Click:
MsgBox Err.Description
Resume Exit_Confirm_Button_Click

End Sub 'End of Confirm_Button_Click//

Regards & God Bless, Edison
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top