Hide a field if the title (date) is 10 days old? (1 Viewer)

Number11

Member
Local time
Today, 12:56
Joined
Jan 29, 2020
Messages
607
So i am wondering if you can hide a field in a form if the title which is a date if its not 10 days from today

field title = a date in the future with a count of available hours like

10/03/2022 14.5
11/03/2022 22.5

so i now need to hide 10/03/2022? as its 11 days from now?
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:56
Joined
May 7, 2009
Messages
19,230
what do you mean by Title? land title? caption?

you can hide it on the Current Event of the form:

private sub form_current()

me.textfieldToHide.Visible = (DateDiff("d", DateValue(theCaption), Date()) = 10)
 

Number11

Member
Local time
Today, 12:56
Joined
Jan 29, 2020
Messages
607
what do you mean by Title? land title? caption?

you can hide it on the Current Event of the form:

private sub form_current()

me.textfieldToHide.Visible = (DateDiff("d", DateValue(theCaption), Date()) = 10)
:(
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:56
Joined
Feb 19, 2002
Messages
43,257
Did you really mean that you only want to hid the date if it is not exactly 10 days from today? So hide it if it is less than 10 days. Show it if it is more than 10 days. Very odd requirement.
 

Number11

Member
Local time
Today, 12:56
Joined
Jan 29, 2020
Messages
607
Did you really mean that you only want to hid the date if it is not exactly 10 days from today? So hide it if it is less than 10 days. Show it if it is more than 10 days. Very odd requirement.
so yes as its overtime hours available for future 10 days post today, dont want to show anything before 10 days, dont think its possible anyways
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:56
Joined
Feb 28, 2001
Messages
27,167
Perfectly possible, but with the clarification in your post #6,

Code:
me.textfieldToHide.Visible = (DateDiff("d", DateValue(theCaption), Date()) >= 10)

This is "show the field if it is 10 OR MORE days in the future. That will do it whether it is a label OR a text box. If you want something more complex than this, please be more specific.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:56
Joined
Feb 19, 2002
Messages
43,257
@Number11 did you not understand my question? Doc is offering an alternate explanation but we are just guessing. If English is not your native language, please let us know so we can simplify our questions.

Asking to hide a field when the date is PRECICESLY 10 days from now is odd at best. And "titles" don't hold data so that is also confusing.
 

Users who are viewing this thread

Top Bottom