473,748 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access - VBA - Add 1 Month to Current Date

29 New Member
Private Function rprtdate()
Dim rprtdates As Date
Dim 1mnth As Integer

1mnth= Month(Date) + Month(DateSeria l(Year(Date), Month(Date) + 1, Day(Date)))

Select Case Frame35.Value
'the following if end user choses one month from the day chosen for reporting period
Case Is = 3
rprtdates = Format(Calendar 1.Value, "mm/dd/yy", vbSunday)
[Beginning] = rprtdates
[ending] = rprtdates + 1mnth

End Select
End Function

HELP ME find a method for adding 1 month to the current date!!! PLEASE !!
Its the 1mnth that is the problem. the fields [beginning] & [ending] fields are okay. I'm new in coding the following methods and how they are used:

dateserial()
dateadd()
format()

If someone can just help me around this current problem with the 1mnth variable and guide me to some article regarding how to properly use the methods regarding dates.

ITs DateAdd ("m", 1, [Date Field]) --isn't it. I am so freaking dumb

---shiznaw
univ of utah
Jun 16 '07 #1
1 10003
shiznaw
29 New Member
Private Function rprtdate()
Dim rprtdates As Date
Dim 1mnth As Integer

1mnth= Month(Date) + Month(DateSeria l(Year(Date), Month(Date) + 1, Day(Date)))

Select Case Frame35.Value
'the following if end user choses one month from the day chosen for reporting period
Case Is = 3
rprtdates = Format(Calendar 1.Value, "mm/dd/yy", vbSunday)
[Beginning] = rprtdates
[ending] = rprtdates + 1mnth

End Select
End Function

HELP ME find a method for adding 1 month to the current date!!! PLEASE !!
Its the 1mnth that is the problem. the fields [beginning] & [ending] fields are okay. I'm new in coding the following methods and how they are used:

dateserial()
dateadd()
format()

If someone can just help me around this current problem with the 1mnth variable and guide me to some article regarding how to properly use the methods regarding dates.

ITs DateAdd ("m", 1, [Date Field]) --isn't it. I am so freaking dumb

---shiznaw
univ of utah
NEver mind...I'm an idiot. Its DateAdd() method. Took out the extra crap. Thanxs anyway.

---shiznaw, the Scripts Villiage Idiot
Jun 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3015
by: Hasanain F. Esmail | last post by:
Hi all, I sincerly thank you all in advance for your help to solve this problem. I have been trying to find a solution to this problem for sometime now but have failed. I am working on a project that requires updating data every month. A typical examle is an apartment rental software but could be applied
2
2410
by: Douglas | last post by:
Can somone help me contruct a simple query Basically I want my query to extract records where the MOT_Due_Date is between the 1st Day of the current month and the date 6 weeks from the 1st day of the current month. My MOT_Due_Day field is in the format "dd<space>mmm" ie 08 Jun and is a text field, not a date field i.e.
6
8989
by: Ante Perkovic | last post by:
Hi, How to declare datetime object and set it to my birthday, first or last day of this month or any other date. I can't find any examples in VS.NET help! BTW, what is the difference between date and datetime classes? Please, help
1
2203
by: ollymr | last post by:
Hi Hope someone can help -- I'm finding this very tricky. I'm working on a school database - this school needs to pay student host families each month. The students stay with the families for different periods. In my student table I have start date and end date fields which correspond to the family stays. However, I just want the families to be paid for the current month -- the family may have had a student for as much as one year or...
3
2227
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID, Transcript.TransCode, Transcript.TransMM, Transcript.TransYY, Transcript.DateKeyed, Transcript.UserID FROM Transcript WHERE datekeyed >= begindate() and datekeyed < enddate() ORDER BY datekeyed;
0
1904
by: larry | last post by:
I am in the process of rewriting one of my first PHP scripts, an event calendar, and wanted to share the code that is the core of the new calendar. My current/previous calendar processed data dates only, this code is intended to use more thrifty event descriptions (3rd saturday, last tuesday, etc.) as well as traditional one-of dates. The core here here is quite spartan, no table logic or or db cruft included (I figure you have our own...
2
1306
by: Shokoth | last post by:
Hi This question may be a bit obvious, but in a query, how do you show just the month of the current date. I am trying to retrieve records of a certain month. Date() will show you the full date, but how but jus the month. I tried checking in the properties but they dont have an option just to show the current month. Is this possible, just to view the currrent month of the current date. If anyone would be able to let me know how to check...
1
19403
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions Date() - Returns the current system date Now() - Returns the current system timestamp (date and time)
0
2363
by: marlberg | last post by:
Platform: Windows2000, WindowsXP, Windows Vista, etc Language: C#, ASP.NET Pre-compiled Libraries: Enterprise Library 3.0 full I have a requirement to implement in and display in C# and ASP.NET a DataGrid with Updatable rows based on a date retrieved from a data table in SQL Server. Below is the design algorithm. 1. Retrieve the Max(rundate) From MyDataTable 2. If the current month -1 = rundate .month from step 1 then 2a. ...
0
8995
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9558
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9331
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9253
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6798
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6077
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2216
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.