Jumat, 28 April 2017

[MS_AccessPros] Label visible or not visible according to conditions

 

Hi All,

I have a Form "MainMenu" it has three Lables. My need is that if on Form "MainMenu" On Load event the conditions are true or false the following labels should be Visible or not Visible.

LabelNotification1
LabelNotification2
LabelNotification3

Form "MainMenu" On Load event is:

Private Sub Form_Load()
    '1st Check
    Me.LabelNotification1.Visible = False
    Dim varZ As Variant
    varZ = DLookup("[MemberID]", "tblPassport", "[PassportExpiryDate]" < Date)
'    varZ = DLookup("[MemberID]", "tblPassport", " Month([PassportExpiryDate])< Month(Date()) And Day([PassportExpiryDate])<Day(Date())")
    If Not IsNull(varZ) Then
        Me.LabelNotification1.Visible = True
    Else
        Me.LabelNotification1.Visible = False
    End If
    '-----------------
    '2nd Check
    Me.LabelNotification2.Visible = False
    Dim varB As Variant
    varB = DLookup("[MemberID]", "tblCNIC", "[CNIC ExpiryDate]" < Date)
    If Not IsNull(varB) Then
        Me.LabelNotification2.Visible = True
    Else
        Me.LabelNotification2.Visible = False
    End If
    '-----------------
    '3rd Check
    Me.LabelNotification3.Visible = False
    Dim varX As Variant
    varX = DLookup("[MemberID]", "Members", " Month([Dob])= Month(Date()) And Day([Dob])=Day(Date())")
    If Not IsNull(varX) Then
        Me.LabelNotification3.Visible = True
    Else
        Me.LabelNotification3.Visible = False
    End If
End Sub
    '-----------------
At present 3rd Check is working correctly, i need correct code for 1st Check and 2nd Check.

Help needed please.

Regards,
Khalid

__._,_.___

Posted by: Khalid Tanweer <khalidtanweerburrah@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