Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a field called "Date_Created", a Label called "ThreeWeeks" and a field called "Due_Date"

    If Date_Created is three week ago or more and if the Due_Date field is empty, then make the ThreeWeeks label visible. Otherwise, hide the ThreeWeeks label.

    This is what I came up with, but it doesn't work. It just displays the ThreeWeeks label all the time:

    Private Sub Form_Open(Cancel As Integer)
    If Date < Me.Date_Created + 21 And Me.Due_Date ="" Then
    Me.ThreeWeeks.Visible = False
    End If
    End Sub

    What am I doing wrong?

    Thanks,

    JoeK

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try this:

    Code:
    If Me.Date_Created <= (Date - 21) And IsNull(Me.Due_Date) Then
      Me.ThreeWeeks.Visible = True
    Else
      Me.ThreeWeeks.Visible = False
    End If
    You could abbreviate this to

    Code:
    Me.ThreeWeeks.Visible = (Me.Date_Created <= (Date - 21) And IsNull(Me.Due_Date))

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='778453' date='05-Jun-2009 12:51']Try this:

    Code:
    If Me.Date_Created <= (Date - 21) And IsNull(Me.Due_Date) Then
      Me.ThreeWeeks.Visible = True
    Else
      Me.ThreeWeeks.Visible = False
    End If
    You could abbreviate this to

    Code:
    Me.ThreeWeeks.Visible = (Me.Date_Created <= (Date - 21) And IsNull(Me.Due_Date))
    [/quote]

    Thanks. Neither code worked for me. I don't know why. However, I ended up building an expression in Conditional Formatting and it does what I need it to do.

    Thanks, anyway.

    JoeK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •