S
Steel Bananana
The following code was given to me by Klatuu to calculate the starting day of
the work week.
PUblic Function WeekStartDate(ByVal BaseDate As Date) As Date
'Dave Hargis 9/04
'Returns the first date of the accounting week for the date entered)
WeekStartDate = DateAdd("d", vbSunday - DatePart("w", BaseDate,
vbMonday), BaseDate)
End Function
However, the line beginning 'WeekStartDate=" is coming up red in VB. It's
based on a date field that is autopopulated and is supposed to insert this
date into an invisible 'week' field. However, it's not doing it!!! I tried
using it as an event procedure as the form opens. I was told that it is a
module code, so I created a module, but I have no idea what to do with it!!!
I can send an example of the table and subform...just in case someone is
willing to help one on one.
Sorry for being such a beginner! I'm ripping my hair out trying to get my
data organized by week so I can view ALL ENTRIES MADE for the week (by date)
and then use a drop-down in a form to view previous week's info.
the work week.
PUblic Function WeekStartDate(ByVal BaseDate As Date) As Date
'Dave Hargis 9/04
'Returns the first date of the accounting week for the date entered)
WeekStartDate = DateAdd("d", vbSunday - DatePart("w", BaseDate,
vbMonday), BaseDate)
End Function
However, the line beginning 'WeekStartDate=" is coming up red in VB. It's
based on a date field that is autopopulated and is supposed to insert this
date into an invisible 'week' field. However, it's not doing it!!! I tried
using it as an event procedure as the form opens. I was told that it is a
module code, so I created a module, but I have no idea what to do with it!!!
I can send an example of the table and subform...just in case someone is
willing to help one on one.
Sorry for being such a beginner! I'm ripping my hair out trying to get my
data organized by week so I can view ALL ENTRIES MADE for the week (by date)
and then use a drop-down in a form to view previous week's info.