M
Manuel
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
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