473,231 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

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 3893


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
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
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
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
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
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
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
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
by: geethaandyou | last post by:
I Need A C Program To Find The Date That Comes After N Days From Todays Date
1
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....
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.