Home > Software design >  Between 2 dates form Validation Access. I've tried many different things and nothing works
Between 2 dates form Validation Access. I've tried many different things and nothing works

Time:02-24

I'm having a hard time figuring out why my code isn't working with this front end form validation rule regarding a range of dates.

So far I've tried many different solutions stated below that have kept yielding me the same error. The data I've been inputting is 03/29/2021 and it's giving me an error when it should be in that range.

Does someone know why and how to go about fixing it? Thank you!

Between #1/1/2012# and Date()

Not IsNull([Date]) And Between #1/1/2012# And #1/1/2024#

Not IsNull([Date]) And Between #1/1/2012# And Date() (I would like to use this one the most to eliminate as much human error as possible)

Not IsNull([Date]) And Between #01/01/2012# And #01/01/2024#

Not IsNull([Date]) And Between #01/01/2012# And Date()

Not IsNull([Date]) And Between #01/01/2012# And >= Date()

CodePudding user response:

There's no Between in VBA. Try with greater than > and less than <:

Not IsNull([Date]) And [Date].Value >= #1/1/2012# And [Date].Value <= Date

CodePudding user response:

This setting for the validation rule works:

Between #01/01/2012# And Date() And Not Is Null
  • Related