If Me.CFINE1.Text > Me.CINIZIO1.Text Then stop
in CFINE1 have "03/2014"
in CINIZIO1 have "03/2026"
why the if condition does not give errors!?
CHECK DATE STRING
-
- Administrator
- Posts: 78586
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: CHECK DATE STRING
"03/2014 is less than "03/2026".
But if CFINE1 = "12/2014" and CINIZIO1 = "03/2021", CFINE1 is larger than CINIZIO1, since you are comparing strings, not dates.
But if CFINE1 = "12/2014" and CINIZIO1 = "03/2021", CFINE1 is larger than CINIZIO1, since you are comparing strings, not dates.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4368
- Joined: 26 Apr 2010, 17:36
Re: CHECK DATE STRING
i need to check exactly the opposite, sorry.
If Me.CINIZIO1.Text > Me.CFINE1 .Text Then stop
and i need to check the two date string
-
- Administrator
- Posts: 78586
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: CHECK DATE STRING
You can see in my code in FILL combobox by combobox how to compare strings such as "03/2014" as dates.
Best wishes,
Hans
Hans