Thanks for the reply, now I am still new to access, how would I connect this
to my weekending field on a table or form? I need the weekending to show up
on a new form each week.
Thanks again in advance.
"Ken Snell (MVP)" wrote:
> This function can be used to do what you seek; put it in a regular module:
>
> ' start of code
> Public Function DateOfSpecificWeekDay(ByVal OriginalDate As Date, _
> ByVal intWeekDay As Integer) As Date
> ' ** THIS FUNCTION RETURNS THE DATE OF THE SPECIFIC DAY OF THE WEEK
> ' ** IN WHICH THE ORIGINAL DATE IS.
> ' ** intWeekDay = 1 is Sunday, 2 is Monday, etc.
>
> On Error Resume Next
>
> DateOfSpecificWeekDay = DateAdd("d", -DatePart("w", OriginalDate, _
> 1) + intWeekDay, OriginalDate)
> Err.Clear
> End Function
> ' end of code
>
>
> Then, the Saturday date for the week containing today's date would be
> SaturdayDate = DateOfSpecificWeekDay(Date(), 7)
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
> "mgkaam" <(E-Mail Removed)> wrote in message
> news:819285A4-86FB-4574-82B1-(E-Mail Removed)...
> >I have a table and the primay key is the weekending date field. I need a
> > default value on this field so that I can have the employee's enter in
> > information from any day and the weekending date would than return the
> > saturday date. Can I do this as a default Value calculations in the
> > table?
> >
> > Thanks in advance!
> >
>
>
>
|