MonthView Calendar Control - ADO DAO RDO RDS

This is a discussion on MonthView Calendar Control - ADO DAO RDO RDS ; I've added a command button to a form (A) which open's another form (B); this second form (B) contains the Microsoft MonthView Control 6.0 (SP4) calendar control. I tied a date field from a table (ActualSaleDt) to the Control Source ...

+ Reply to Thread
Results 1 to 8 of 8

MonthView Calendar Control

  1. Default MonthView Calendar Control

    I've added a command button to a form (A) which open's another form (B); this
    second form (B) contains the Microsoft MonthView Control 6.0 (SP4) calendar
    control. I tied a date field from a table (ActualSaleDt) to the Control
    Source property of the control; the table is the RecordSorce for form B (and,
    indecently, form A as well).

    Basically, I added the ActualSaleDt field to form A, and am using form B,
    which houses the calendar control, to allow the user to select a date from a
    calendar (as opposed to having to manually type the date into the
    ActualSaleDt field on the form).

    This works fine.

    In the AfterUpdate Event of the ActualSaleDt form field I call a function
    which archives the data into a table when changes are made. Here's the code.

    Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)

    Dim db As DAO.Database
    Dim rst As DAO.Recordset

    If IsNull(SaleDt) Then Exit Function

    Set db = CurrentDb
    Set rst = db.OpenRecordset("tbl_SaleDateHist")


    rst.AddNew
    rst("LoanNum").Value = LnNm
    rst("SaleDateHist").Value = SaleDt
    rst.Update
    rst.Close

    End Function

    This code works beautifully when the user changes the date directly in the
    ActualSaleDt field on the form, but does not work when the user changes the
    date using the calendar control; the AfterUpdate does not fire.

    Any ideas as to how I can get the VBA code to fire when the user updates the
    date using the calendar control?

    Thanks,

    Manuel


  2. Default Re: MonthView Calendar Control

    On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    <Manuel@discussions.microsoft.com> wrote:

    Is there a way you can simply call the AfterUpdate procedure yourself?
    -Tom.


    >I've added a command button to a form (A) which open's another form (B); this
    >second form (B) contains the Microsoft MonthView Control 6.0 (SP4) calendar
    >control. I tied a date field from a table (ActualSaleDt) to the Control
    >Source property of the control; the table is the RecordSorce for form B (and,
    >indecently, form A as well).
    >
    >Basically, I added the ActualSaleDt field to form A, and am using form B,
    >which houses the calendar control, to allow the user to select a date from a
    >calendar (as opposed to having to manually type the date into the
    >ActualSaleDt field on the form).
    >
    >This works fine.
    >
    >In the AfterUpdate Event of the ActualSaleDt form field I call a function
    >which archives the data into a table when changes are made. Here's the code.
    >
    >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    >
    >Dim db As DAO.Database
    >Dim rst As DAO.Recordset
    >
    >If IsNull(SaleDt) Then Exit Function
    >
    >Set db = CurrentDb
    >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    >
    >
    >rst.AddNew
    >rst("LoanNum").Value = LnNm
    >rst("SaleDateHist").Value = SaleDt
    >rst.Update
    >rst.Close
    >
    >End Function
    >
    >This code works beautifully when the user changes the date directly in the
    >ActualSaleDt field on the form, but does not work when the user changes the
    >date using the calendar control; the AfterUpdate does not fire.
    >
    >Any ideas as to how I can get the VBA code to fire when the user updates the
    >date using the calendar control?
    >
    >Thanks,
    >
    >Manuel


  3. Default Re: MonthView Calendar Control

    Problem is that I'd rather not have the user have to call the function
    manually by selecting another command button (for example). The code works
    so nicely when the user updates the ActualSaleDt field directly; I'd like the
    code to execute automatically when the update to the field is done via the
    calendar control.

    "Tom van Stiphout" wrote:

    > On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    > <Manuel@discussions.microsoft.com> wrote:
    >
    > Is there a way you can simply call the AfterUpdate procedure yourself?
    > -Tom.
    >
    >
    > >I've added a command button to a form (A) which open's another form (B); this
    > >second form (B) contains the Microsoft MonthView Control 6.0 (SP4) calendar
    > >control. I tied a date field from a table (ActualSaleDt) to the Control
    > >Source property of the control; the table is the RecordSorce for form B (and,
    > >indecently, form A as well).
    > >
    > >Basically, I added the ActualSaleDt field to form A, and am using form B,
    > >which houses the calendar control, to allow the user to select a date from a
    > >calendar (as opposed to having to manually type the date into the
    > >ActualSaleDt field on the form).
    > >
    > >This works fine.
    > >
    > >In the AfterUpdate Event of the ActualSaleDt form field I call a function
    > >which archives the data into a table when changes are made. Here's the code.
    > >
    > >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    > >
    > >Dim db As DAO.Database
    > >Dim rst As DAO.Recordset
    > >
    > >If IsNull(SaleDt) Then Exit Function
    > >
    > >Set db = CurrentDb
    > >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    > >
    > >
    > >rst.AddNew
    > >rst("LoanNum").Value = LnNm
    > >rst("SaleDateHist").Value = SaleDt
    > >rst.Update
    > >rst.Close
    > >
    > >End Function
    > >
    > >This code works beautifully when the user changes the date directly in the
    > >ActualSaleDt field on the form, but does not work when the user changes the
    > >date using the calendar control; the AfterUpdate does not fire.
    > >
    > >Any ideas as to how I can get the VBA code to fire when the user updates the
    > >date using the calendar control?
    > >
    > >Thanks,
    > >
    > >Manuel

    >


  4. Default Re: MonthView Calendar Control

    So you can use calendar click event to run then same proc, just make sure it
    is declared as public

    --
    Best regards,
    ___________
    Alex Dybenko (MVP)
    http://accessblog.net
    http://www.PointLtd.com

    "Manuel" <Manuel@discussions.microsoft.com> wrote in message
    news:92EADE31-08E4-4F03-BCFA-8F9567B8F085@microsoft.com...
    > Problem is that I'd rather not have the user have to call the function
    > manually by selecting another command button (for example). The code
    > works
    > so nicely when the user updates the ActualSaleDt field directly; I'd like
    > the
    > code to execute automatically when the update to the field is done via the
    > calendar control.
    >
    > "Tom van Stiphout" wrote:
    >
    >> On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    >> <Manuel@discussions.microsoft.com> wrote:
    >>
    >> Is there a way you can simply call the AfterUpdate procedure yourself?
    >> -Tom.
    >>
    >>
    >> >I've added a command button to a form (A) which open's another form (B);
    >> >this
    >> >second form (B) contains the Microsoft MonthView Control 6.0 (SP4)
    >> >calendar
    >> >control. I tied a date field from a table (ActualSaleDt) to the Control
    >> >Source property of the control; the table is the RecordSorce for form B
    >> >(and,
    >> >indecently, form A as well).
    >> >
    >> >Basically, I added the ActualSaleDt field to form A, and am using form
    >> >B,
    >> >which houses the calendar control, to allow the user to select a date
    >> >from a
    >> >calendar (as opposed to having to manually type the date into the
    >> >ActualSaleDt field on the form).
    >> >
    >> >This works fine.
    >> >
    >> >In the AfterUpdate Event of the ActualSaleDt form field I call a
    >> >function
    >> >which archives the data into a table when changes are made. Here's the
    >> >code.
    >> >
    >> >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    >> >
    >> >Dim db As DAO.Database
    >> >Dim rst As DAO.Recordset
    >> >
    >> >If IsNull(SaleDt) Then Exit Function
    >> >
    >> >Set db = CurrentDb
    >> >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    >> >
    >> >
    >> >rst.AddNew
    >> >rst("LoanNum").Value = LnNm
    >> >rst("SaleDateHist").Value = SaleDt
    >> >rst.Update
    >> >rst.Close
    >> >
    >> >End Function
    >> >
    >> >This code works beautifully when the user changes the date directly in
    >> >the
    >> >ActualSaleDt field on the form, but does not work when the user changes
    >> >the
    >> >date using the calendar control; the AfterUpdate does not fire.
    >> >
    >> >Any ideas as to how I can get the VBA code to fire when the user updates
    >> >the
    >> >date using the calendar control?
    >> >
    >> >Thanks,
    >> >
    >> >Manuel

    >>



  5. Default Re: MonthView Calendar Control

    On Sat, 1 Mar 2008 20:53:00 -0800, Manuel
    <Manuel@discussions.microsoft.com> wrote:

    I meant what Alex said: call the AfterUpdate procedure from the
    appropriate event procedure. This doesn't happen automatically, that's
    why I used the term "manually".

    -Tom.



    >Problem is that I'd rather not have the user have to call the function
    >manually by selecting another command button (for example). The code works
    >so nicely when the user updates the ActualSaleDt field directly; I'd like the
    >code to execute automatically when the update to the field is done via the
    >calendar control.
    >
    >"Tom van Stiphout" wrote:
    >
    >> On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    >> <Manuel@discussions.microsoft.com> wrote:
    >>
    >> Is there a way you can simply call the AfterUpdate procedure yourself?
    >> -Tom.
    >>
    >>
    >> >I've added a command button to a form (A) which open's another form (B); this
    >> >second form (B) contains the Microsoft MonthView Control 6.0 (SP4) calendar
    >> >control. I tied a date field from a table (ActualSaleDt) to the Control
    >> >Source property of the control; the table is the RecordSorce for form B (and,
    >> >indecently, form A as well).
    >> >
    >> >Basically, I added the ActualSaleDt field to form A, and am using form B,
    >> >which houses the calendar control, to allow the user to select a date from a
    >> >calendar (as opposed to having to manually type the date into the
    >> >ActualSaleDt field on the form).
    >> >
    >> >This works fine.
    >> >
    >> >In the AfterUpdate Event of the ActualSaleDt form field I call a function
    >> >which archives the data into a table when changes are made. Here's the code.
    >> >
    >> >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    >> >
    >> >Dim db As DAO.Database
    >> >Dim rst As DAO.Recordset
    >> >
    >> >If IsNull(SaleDt) Then Exit Function
    >> >
    >> >Set db = CurrentDb
    >> >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    >> >
    >> >
    >> >rst.AddNew
    >> >rst("LoanNum").Value = LnNm
    >> >rst("SaleDateHist").Value = SaleDt
    >> >rst.Update
    >> >rst.Close
    >> >
    >> >End Function
    >> >
    >> >This code works beautifully when the user changes the date directly in the
    >> >ActualSaleDt field on the form, but does not work when the user changes the
    >> >date using the calendar control; the AfterUpdate does not fire.
    >> >
    >> >Any ideas as to how I can get the VBA code to fire when the user updates the
    >> >date using the calendar control?
    >> >
    >> >Thanks,
    >> >
    >> >Manuel

    >>


  6. Default Re: MonthView Calendar Control

    I appreciate your responses, but the MonthView Active X calendar control does
    not have an After Update Event. The only available Events are: On Updated,
    On Enter, On Exit, On Got Focus, and On Lost Focus.

    I can call the code from the "On Lost Focus" Event, but that runs the code
    each time the form (B) is closed. I only want the code to run when the date
    in the field is changed.

    Manuel

    "Tom van Stiphout" wrote:

    > On Sat, 1 Mar 2008 20:53:00 -0800, Manuel
    > <Manuel@discussions.microsoft.com> wrote:
    >
    > I meant what Alex said: call the AfterUpdate procedure from the
    > appropriate event procedure. This doesn't happen automatically, that's
    > why I used the term "manually".
    >
    > -Tom.
    >
    >
    >
    > >Problem is that I'd rather not have the user have to call the function
    > >manually by selecting another command button (for example). The code works
    > >so nicely when the user updates the ActualSaleDt field directly; I'd like the
    > >code to execute automatically when the update to the field is done via the
    > >calendar control.
    > >
    > >"Tom van Stiphout" wrote:
    > >
    > >> On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    > >> <Manuel@discussions.microsoft.com> wrote:
    > >>
    > >> Is there a way you can simply call the AfterUpdate procedure yourself?
    > >> -Tom.
    > >>
    > >>
    > >> >I've added a command button to a form (A) which open's another form (B); this
    > >> >second form (B) contains the Microsoft MonthView Control 6.0 (SP4) calendar
    > >> >control. I tied a date field from a table (ActualSaleDt) to the Control
    > >> >Source property of the control; the table is the RecordSorce for form B (and,
    > >> >indecently, form A as well).
    > >> >
    > >> >Basically, I added the ActualSaleDt field to form A, and am using form B,
    > >> >which houses the calendar control, to allow the user to select a date from a
    > >> >calendar (as opposed to having to manually type the date into the
    > >> >ActualSaleDt field on the form).
    > >> >
    > >> >This works fine.
    > >> >
    > >> >In the AfterUpdate Event of the ActualSaleDt form field I call a function
    > >> >which archives the data into a table when changes are made. Here's the code.
    > >> >
    > >> >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    > >> >
    > >> >Dim db As DAO.Database
    > >> >Dim rst As DAO.Recordset
    > >> >
    > >> >If IsNull(SaleDt) Then Exit Function
    > >> >
    > >> >Set db = CurrentDb
    > >> >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    > >> >
    > >> >
    > >> >rst.AddNew
    > >> >rst("LoanNum").Value = LnNm
    > >> >rst("SaleDateHist").Value = SaleDt
    > >> >rst.Update
    > >> >rst.Close
    > >> >
    > >> >End Function
    > >> >
    > >> >This code works beautifully when the user changes the date directly in the
    > >> >ActualSaleDt field on the form, but does not work when the user changes the
    > >> >date using the calendar control; the AfterUpdate does not fire.
    > >> >
    > >> >Any ideas as to how I can get the VBA code to fire when the user updates the
    > >> >date using the calendar control?
    > >> >
    > >> >Thanks,
    > >> >
    > >> >Manuel
    > >>

    >


  7. Default Re: MonthView Calendar Control

    Hi,
    there are more events, look here:
    http://accessblog.net/2008/03/active...ol-events.html

    --
    Best regards,
    ___________
    Alex Dybenko (MVP)
    http://accessblog.net
    http://www.PointLtd.com


    "Manuel" <Manuel@discussions.microsoft.com> wrote in message
    news:3481BBC9-29E3-4F1F-BCBA-236AEBB851C7@microsoft.com...
    >I appreciate your responses, but the MonthView Active X calendar control
    >does
    > not have an After Update Event. The only available Events are: On
    > Updated,
    > On Enter, On Exit, On Got Focus, and On Lost Focus.
    >
    > I can call the code from the "On Lost Focus" Event, but that runs the code
    > each time the form (B) is closed. I only want the code to run when the
    > date
    > in the field is changed.
    >
    > Manuel
    >
    > "Tom van Stiphout" wrote:
    >
    >> On Sat, 1 Mar 2008 20:53:00 -0800, Manuel
    >> <Manuel@discussions.microsoft.com> wrote:
    >>
    >> I meant what Alex said: call the AfterUpdate procedure from the
    >> appropriate event procedure. This doesn't happen automatically, that's
    >> why I used the term "manually".
    >>
    >> -Tom.
    >>
    >>
    >>
    >> >Problem is that I'd rather not have the user have to call the function
    >> >manually by selecting another command button (for example). The code
    >> >works
    >> >so nicely when the user updates the ActualSaleDt field directly; I'd
    >> >like the
    >> >code to execute automatically when the update to the field is done via
    >> >the
    >> >calendar control.
    >> >
    >> >"Tom van Stiphout" wrote:
    >> >
    >> >> On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    >> >> <Manuel@discussions.microsoft.com> wrote:
    >> >>
    >> >> Is there a way you can simply call the AfterUpdate procedure yourself?
    >> >> -Tom.
    >> >>
    >> >>
    >> >> >I've added a command button to a form (A) which open's another form
    >> >> >(B); this
    >> >> >second form (B) contains the Microsoft MonthView Control 6.0 (SP4)
    >> >> >calendar
    >> >> >control. I tied a date field from a table (ActualSaleDt) to the
    >> >> >Control
    >> >> >Source property of the control; the table is the RecordSorce for form
    >> >> >B (and,
    >> >> >indecently, form A as well).
    >> >> >
    >> >> >Basically, I added the ActualSaleDt field to form A, and am using
    >> >> >form B,
    >> >> >which houses the calendar control, to allow the user to select a date
    >> >> >from a
    >> >> >calendar (as opposed to having to manually type the date into the
    >> >> >ActualSaleDt field on the form).
    >> >> >
    >> >> >This works fine.
    >> >> >
    >> >> >In the AfterUpdate Event of the ActualSaleDt form field I call a
    >> >> >function
    >> >> >which archives the data into a table when changes are made. Here's
    >> >> >the code.
    >> >> >
    >> >> >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    >> >> >
    >> >> >Dim db As DAO.Database
    >> >> >Dim rst As DAO.Recordset
    >> >> >
    >> >> >If IsNull(SaleDt) Then Exit Function
    >> >> >
    >> >> >Set db = CurrentDb
    >> >> >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    >> >> >
    >> >> >
    >> >> >rst.AddNew
    >> >> >rst("LoanNum").Value = LnNm
    >> >> >rst("SaleDateHist").Value = SaleDt
    >> >> >rst.Update
    >> >> >rst.Close
    >> >> >
    >> >> >End Function
    >> >> >
    >> >> >This code works beautifully when the user changes the date directly
    >> >> >in the
    >> >> >ActualSaleDt field on the form, but does not work when the user
    >> >> >changes the
    >> >> >date using the calendar control; the AfterUpdate does not fire.
    >> >> >
    >> >> >Any ideas as to how I can get the VBA code to fire when the user
    >> >> >updates the
    >> >> >date using the calendar control?
    >> >> >
    >> >> >Thanks,
    >> >> >
    >> >> >Manuel
    >> >>

    >>



  8. Default Re: MonthView Calendar Control

    Ahhh... that worked... not very intuitive. Thanks so much for not giving up
    on this, I really appreciate it!

    Manuel

    "Alex Dybenko" wrote:

    > Hi,
    > there are more events, look here:
    > http://accessblog.net/2008/03/active...ol-events.html
    >
    > --
    > Best regards,
    > ___________
    > Alex Dybenko (MVP)
    > http://accessblog.net
    > http://www.PointLtd.com
    >
    >
    > "Manuel" <Manuel@discussions.microsoft.com> wrote in message
    > news:3481BBC9-29E3-4F1F-BCBA-236AEBB851C7@microsoft.com...
    > >I appreciate your responses, but the MonthView Active X calendar control
    > >does
    > > not have an After Update Event. The only available Events are: On
    > > Updated,
    > > On Enter, On Exit, On Got Focus, and On Lost Focus.
    > >
    > > I can call the code from the "On Lost Focus" Event, but that runs the code
    > > each time the form (B) is closed. I only want the code to run when the
    > > date
    > > in the field is changed.
    > >
    > > Manuel
    > >
    > > "Tom van Stiphout" wrote:
    > >
    > >> On Sat, 1 Mar 2008 20:53:00 -0800, Manuel
    > >> <Manuel@discussions.microsoft.com> wrote:
    > >>
    > >> I meant what Alex said: call the AfterUpdate procedure from the
    > >> appropriate event procedure. This doesn't happen automatically, that's
    > >> why I used the term "manually".
    > >>
    > >> -Tom.
    > >>
    > >>
    > >>
    > >> >Problem is that I'd rather not have the user have to call the function
    > >> >manually by selecting another command button (for example). The code
    > >> >works
    > >> >so nicely when the user updates the ActualSaleDt field directly; I'd
    > >> >like the
    > >> >code to execute automatically when the update to the field is done via
    > >> >the
    > >> >calendar control.
    > >> >
    > >> >"Tom van Stiphout" wrote:
    > >> >
    > >> >> On Sat, 1 Mar 2008 18:39:00 -0800, Manuel
    > >> >> <Manuel@discussions.microsoft.com> wrote:
    > >> >>
    > >> >> Is there a way you can simply call the AfterUpdate procedure yourself?
    > >> >> -Tom.
    > >> >>
    > >> >>
    > >> >> >I've added a command button to a form (A) which open's another form
    > >> >> >(B); this
    > >> >> >second form (B) contains the Microsoft MonthView Control 6.0 (SP4)
    > >> >> >calendar
    > >> >> >control. I tied a date field from a table (ActualSaleDt) to the
    > >> >> >Control
    > >> >> >Source property of the control; the table is the RecordSorce for form
    > >> >> >B (and,
    > >> >> >indecently, form A as well).
    > >> >> >
    > >> >> >Basically, I added the ActualSaleDt field to form A, and am using
    > >> >> >form B,
    > >> >> >which houses the calendar control, to allow the user to select a date
    > >> >> >from a
    > >> >> >calendar (as opposed to having to manually type the date into the
    > >> >> >ActualSaleDt field on the form).
    > >> >> >
    > >> >> >This works fine.
    > >> >> >
    > >> >> >In the AfterUpdate Event of the ActualSaleDt form field I call a
    > >> >> >function
    > >> >> >which archives the data into a table when changes are made. Here's
    > >> >> >the code.
    > >> >> >
    > >> >> >Public Function ArchActSaleDt(SaleDt As Date, LnNm As Double)
    > >> >> >
    > >> >> >Dim db As DAO.Database
    > >> >> >Dim rst As DAO.Recordset
    > >> >> >
    > >> >> >If IsNull(SaleDt) Then Exit Function
    > >> >> >
    > >> >> >Set db = CurrentDb
    > >> >> >Set rst = db.OpenRecordset("tbl_SaleDateHist")
    > >> >> >
    > >> >> >
    > >> >> >rst.AddNew
    > >> >> >rst("LoanNum").Value = LnNm
    > >> >> >rst("SaleDateHist").Value = SaleDt
    > >> >> >rst.Update
    > >> >> >rst.Close
    > >> >> >
    > >> >> >End Function
    > >> >> >
    > >> >> >This code works beautifully when the user changes the date directly
    > >> >> >in the
    > >> >> >ActualSaleDt field on the form, but does not work when the user
    > >> >> >changes the
    > >> >> >date using the calendar control; the AfterUpdate does not fire.
    > >> >> >
    > >> >> >Any ideas as to how I can get the VBA code to fire when the user
    > >> >> >updates the
    > >> >> >date using the calendar control?
    > >> >> >
    > >> >> >Thanks,
    > >> >> >
    > >> >> >Manuel
    > >> >>
    > >>

    >
    >


+ Reply to Thread