Week form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kd

    #1

    Week form

    I have a table with 5 days and weekno on it
    it supplys 10 years woth of dates for sub forms for schedule
    iam looking for advice on best approach to open form frmSchedule to
    current date

    tblWeek


    fields
    Day1-----------Mon
    Day2---Tues
    Day3--Wed
    Day4--Thurs
    Day5---Fri
    WeekNo--yyyy--ww
    Thanks for any and all input

  • Allen Browne

    #2
    Re: Week form

    Presumably you want all dates to be available, but for the form to
    automatically open to today's date. Use the Load event of the form to find
    today's record.

    This kind of thing:

    Private Sub Form_Load()
    Dim strWhere As String
    If Not Me.NewRecord Then
    strWhere = "[ScheduleDate] = " & Format(Date, "\#mm\/dd\/yyyy\#")
    With Me.RecordsetClo ne
    .FindFirst strWhere
    If .NoMatch Then
    RunCommand acCmdRecordsGot oNew
    Else
    Me.Bookmark = .Bookmark
    End If
    End With
    End If
    End Sub

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Kd" <ken_d128@yahoo .com> wrote in message
    news:1136518499 .389760.139600@ g47g2000cwa.goo glegroups.com.. .[color=blue]
    >I have a table with 5 days and weekno on it
    > it supplys 10 years woth of dates for sub forms for schedule
    > iam looking for advice on best approach to open form frmSchedule to
    > current date
    >
    > tblWeek
    >
    >
    > fields
    > Day1-----------Mon
    > Day2---Tues
    > Day3--Wed
    > Day4--Thurs
    > Day5---Fri
    > WeekNo--yyyy--ww
    > Thanks for any and all input[/color]


    Comment

    Working...