By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Comepare todays date with date + 60 days

P: n/a
Hello, I am having isues with the following:

I have two forms, a MAIN FORM with a SUB FORM:

Within the MAIN FORM, I have an unbound textbox (Date Format) and a
command button. Onload, the textbox defualts to Date().

The SUB FORM has a bound textbox (Date Format).

I am trying to create the code for the command button to compare the
two dates. If the SUB FORM textbox (containing the date) + 60 Days is
greater the MAIN FORMS date (todays date) then open a form, else open
another form.

The Pseudocode I have come up with is the following:

If Subform textbox + 60 days Mainform textbox then
Open Form 1
Else
Open Form 2

When I run the code, i don't think it is recognizing the date + 60
days. Any suggestions on the "+ 60 days" syntax?

Thank you in advance!

Mar 12 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a


When working with dates it's best to use the various date functions -
DateAdd, DateDiff, DatePart etc. While adding 60 to a date will add 60
days, the specific functions provide more uniform results as well as
being able to work with more than just days. I don't really see
anything logically wrong with your example, but if that's what you are
actually running, then no it won't work. Are you getting an error
message? Unexpected result?

Mar 12 '07 #2

P: n/a
On Mar 12, 2:26 pm, "storrboy" <storr...@sympatico.cawrote:
When working with dates it's best to use the various date functions -
DateAdd, DateDiff, DatePart etc. While adding 60 to a date will add 60
days, the specific functions provide more uniform results as well as
being able to work with more than just days. I don't really see
anything logically wrong with your example, but if that's what you are
actually running, then no it won't work. Are you getting an error
message? Unexpected result?
I used DateAdd, works great!!! Thank you!

Mar 15 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.