D
Dan @BCBS
I need to capture the current date/time when a record was deleted.
This command buttons code writes the date to a table.. Everything works
fine except I cannot get the date/time to write to the table...
In the code below my problem seems to be: lCriteria = lCriteria & Date & "
AS tDate "
Private Sub cmdDelete_Click()
Dim lCriteria As String
Dim lICCNNO As String
Dim lRacfid As String
lICCNNO = Me!ICNNO
If MsgBox("Are you sure you want to delete ICN No. " & lICCNNO,
vbQuestion & vbYesNo, gAppname) = vbYes Then
DoCmd.SetWarnings False
Dim lID As Long
lID = GetNewID("tblTrackingDataDeleted")
lCriteria = "INSERT INTO tblTrackingDataDeleted ( ID, ICNNO,
MEMBERNO, TR_PRODUCT, TR_WHEN, "
lCriteria = lCriteria & "SELECT " & lID & " AS tID,
tblTrackingData.ICNNO, tblTrackingData.MEMBERNO, "
lCriteria = lCriteria & "tblTrackingData.TR_PRODUCT, "
lCriteria = lCriteria & Date & " AS tDate "
lCriteria = lCriteria & "FROM tblTrackingData "
lCriteria = lCriteria & "WHERE (((tblTrackingData.ICNNO)=" &
"""" & lICCNNO & """" & "));"
DoCmd.RunSQL lCriteria
Any Suggestions
This command buttons code writes the date to a table.. Everything works
fine except I cannot get the date/time to write to the table...
In the code below my problem seems to be: lCriteria = lCriteria & Date & "
AS tDate "
Private Sub cmdDelete_Click()
Dim lCriteria As String
Dim lICCNNO As String
Dim lRacfid As String
lICCNNO = Me!ICNNO
If MsgBox("Are you sure you want to delete ICN No. " & lICCNNO,
vbQuestion & vbYesNo, gAppname) = vbYes Then
DoCmd.SetWarnings False
Dim lID As Long
lID = GetNewID("tblTrackingDataDeleted")
lCriteria = "INSERT INTO tblTrackingDataDeleted ( ID, ICNNO,
MEMBERNO, TR_PRODUCT, TR_WHEN, "
lCriteria = lCriteria & "SELECT " & lID & " AS tID,
tblTrackingData.ICNNO, tblTrackingData.MEMBERNO, "
lCriteria = lCriteria & "tblTrackingData.TR_PRODUCT, "
lCriteria = lCriteria & Date & " AS tDate "
lCriteria = lCriteria & "FROM tblTrackingData "
lCriteria = lCriteria & "WHERE (((tblTrackingData.ICNNO)=" &
"""" & lICCNNO & """" & "));"
DoCmd.RunSQL lCriteria
Any Suggestions