T
Tim
I have a form which is used to track receipt of packages.
When the user updates the Date_Received field on the form,
a record is written to another table using the code shown
below. I have also written code so that when the user
double-clicks on the field, today's date is entered (which
is simply Me!Date_Received = Date). My problem is that if
the user enters the date manually, the update code works,
but it doesn't if they double-click. Any ideas why?
Private Sub Date_Received_AfterUpdate()
Dim CurrDB As Database
Dim CurrTab As Recordset
Set CurrDB = CurrentDb
Set CurrTab = CurrDB.OpenRecordset("tbl_History")
With CurrTab
.AddNew
CurrTab!Case_ID = Me!Case_ID
CurrTab!Status = 2
CurrTab.Update
End With
Set CurrDB = Nothing
Set CurrTab = Nothing
End Sub
When the user updates the Date_Received field on the form,
a record is written to another table using the code shown
below. I have also written code so that when the user
double-clicks on the field, today's date is entered (which
is simply Me!Date_Received = Date). My problem is that if
the user enters the date manually, the update code works,
but it doesn't if they double-click. Any ideas why?
Private Sub Date_Received_AfterUpdate()
Dim CurrDB As Database
Dim CurrTab As Recordset
Set CurrDB = CurrentDb
Set CurrTab = CurrDB.OpenRecordset("tbl_History")
With CurrTab
.AddNew
CurrTab!Case_ID = Me!Case_ID
CurrTab!Status = 2
CurrTab.Update
End With
Set CurrDB = Nothing
Set CurrTab = Nothing
End Sub