First Date of Next Quarter

E

E.Q.

I have a paper form that I'd like to replace with a database. The form is an
Opt-In form that must be filled before the beginning of each quarter. The
paper form request that the employee circle the quarter.
I've created two tables:
tblOpMaint:
chrEmpIDNo (Key)
chrLastName
chrFirstName

tblQuarterOption:
lngBuyInID (autonumber Key)
chrEmpID (secondary key)
dtmQuarter
dtmRequestDate

By contract, the form must be filled out (dtmRequestDate) at least 15 days
prior to the start of the quarter; for the database I would simply like to
default the form to the first day of the next quarter (for the dtmQuarter
field). How do I calculate the first day of the next quarter and put it on my
form?
 
A

Arvin Meyer [MVP]

This should give you the start of the next quarter (untested):

Function StartOfNextQuarter(D As Variant) As Variant
If VarType(D) <> vbDate Then
StartOfNextQuarter = Null
Else
StartOfNextQuarter = DateSerial(Year(D), Month(D) - (Month(D) - 1) Mod 3
+ 3, 1)
End If
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top