Rabu, 10 Mei 2017

[MS_AccessPros] Date Validation

 

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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar