Full Version: first day of next month based on the date of another ffield
UtterAccess Forums > Microsoft® Access > Access Forms
col
I'm working on an invoice for a client. Is there anyway to find the first day of the next month based on the date of another field. Say for example, and log entry was made on oct 15, 2004. I need a way to identify the first day in the next month (nov 1, 2004). this is needed because my client bills on the first day of the next month for all work done in the previous month and i need to count from the first day of the next month to determin how old the invoice is.

any suggestions?
Edited by: col on Wed Nov 3 0:47:24 EST 2004.
r_cubed
Dim FirstOfNextMonth as Date
irstOfNextMonth = DateSerial(Year(DateAdd("m", 1,<YourDateField>)), Month(DateAdd("m", 1, <YourDateField>)), 1)
col
thanks for the suggestion, but i get a syntax error when the code runs:
irstOfNextMonth = DateSerial(Year(DateAdd("m", 1,enddate), Month(DateAdd("m", 1, enddate)), 1)
enddate is the field i want to look at to find the first day of next month.
r_cubed
You haven't said where you are running this code from. Is it from a form, within a query, a report, in code module etc.
EndDate' may ( ? ) be a field, but a field from where ????
raskew
Try -
irstOfNextMonth = DateSerial(Year([EndDate]), Month([EndDate]) + 1, 1)
Bob
col
i am running the code on form open. then using firstofnextmonth as the control source for the textbox.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.