Hello
I am doing a date validation, comparing the Begin Date and the End Date. The RUN button will be enabled only when the Begin Date is less than the End Date. The code that I have here, sometimes it's working right and sometimes it doesn't. I wasn't able to figured out the errors. What is the correct way to do it?
Phucon
Private Sub cboBeginDate_BeforeUpdate(Cancel As Integer)
With Me
If Not .cboBeginDate & "" = "" And Not .cboEndDate & "" = "" Then
If .cboBeginDate.Value <= .cboEndDate.Value Then
!cmdRun.Enabled = True
!cmdClear.Enabled = True
Else
!cmdRun.Enabled = False
End If
End If
End With
End Sub
Private Sub cboEndDate_BeforeUpdate(Cancel As Integer)
With Me
If Not .cboBeginDate & "" = "" And Not .cboEndDate & "" = "" Then
If .cboBeginDate.Value <= .cboEndDate.Value Then
!cmdRun.Enabled = True
!cmdClear.Enabled = True
Else
!cmdRun.Enabled = False
End If
End If
End With
End Sub
Posted by: saigonf7q5@yahoo.com
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar