473,480 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Comepare todays date with date + 60 days

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
2 3901


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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2630
by: Gerry Viator | last post by:
Hi all, I have a textbox were a time is typed in like: upto 4 numbers 1900 300 1000 1425 I would like as they type the text to show todays date plus the time they
2
38351
by: Chuck | last post by:
Using a macro to output a query to an Excel file. Is there a way to automatically add todays date in the file spec? As: C:\Access Data\ & todays date.xls Chuck ....
5
11972
by: Vayse | last post by:
In VB6, I would have used Date() That no longer works. How do I find todays date in VB.net?
1
1445
by: Mark12345 | last post by:
Hi all before I begin to tell you my problems just a big thanks to Mary McCarthy who helped me lots. Thank You Mary!!! Right todays problems are Getting the date in my form automatically. (read...
2
3754
by: Luqman | last post by:
Hi, Any Idea how to Display Todays Date in DetailView Template Field while Inserting ? For example: When I click on New Button of DetailView Control, I need to display Today's Date in a...
2
29744
by: kbaisch | last post by:
I have this code set up but I know the 3rd line is wrong. Could someone please help me on the code for pulling all entries for todays date -90 days? I would really appreciate it and thanks for...
3
4192
by: jonosborne | last post by:
Hi guys, im a bit of a novice being thrown in at the deep end ! Using MS Access 97 i have a table with data that is updated once a day from an Excel spreadsheet. I need a way of identifying when data...
1
1868
by: geethaandyou | last post by:
I Need A C Program To Find The Date That Comes After N Days From Todays Date
1
2819
by: phpmel | last post by:
Hi guys, I have an asp calendar control, text box, calendar icon, eraser icon all within an update panel. The calendar works fine, postbacks are handled without the flickering of the screen etc....
0
7049
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7092
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6981
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
565
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.