G
Gina Whipp
This is my third StrSQL and I can't for the life of me figure out why this
won't run. Any help would be appreciated...
RecDetect = DLookup("[AssociateID]", "tblAssociateActivities",
"[AssociateID] = " & Me![cboAssociateID] & " AND [ActivityDate] = #" &
Format(TDate, "mm/dd/yy") & "#")
If IsNull(RecDetect) Then
StrSQL = "INSERT INTO tblAssociateActivities ( AssociateID,
ActivityDate, ActivityID, TimeDecimal ) " _
& "SELECT " & Me![cboAssociateID] & " AS F1, #" _
& Format(TDate, "mm/dd/yy") & "# AS F2, " & TypeAttend & " AS F3 " _
& 8 " AS TimeDecimal;"
DoCmd.RunSQL StrSQL
Else
StrSQL = "UPDATE tblAssociateActivities SET
tblAssociateActivities.ActivityID = " _
& TypeAttend & tblAssociateActivities.TimeDecimal = 8 _
& " WHERE (((tblAssociateActivities.AssociateID)=" & Me![cboAssociateID]
& ") AND" _
& "((tblAssociateActivities.ActivityDate)=#" & Format(TDate, "mm/dd/yy")
& "#));"
DoCmd.RunSQL StrSQL
End If
As always THANKS!
won't run. Any help would be appreciated...
RecDetect = DLookup("[AssociateID]", "tblAssociateActivities",
"[AssociateID] = " & Me![cboAssociateID] & " AND [ActivityDate] = #" &
Format(TDate, "mm/dd/yy") & "#")
If IsNull(RecDetect) Then
StrSQL = "INSERT INTO tblAssociateActivities ( AssociateID,
ActivityDate, ActivityID, TimeDecimal ) " _
& "SELECT " & Me![cboAssociateID] & " AS F1, #" _
& Format(TDate, "mm/dd/yy") & "# AS F2, " & TypeAttend & " AS F3 " _
& 8 " AS TimeDecimal;"
DoCmd.RunSQL StrSQL
Else
StrSQL = "UPDATE tblAssociateActivities SET
tblAssociateActivities.ActivityID = " _
& TypeAttend & tblAssociateActivities.TimeDecimal = 8 _
& " WHERE (((tblAssociateActivities.AssociateID)=" & Me![cboAssociateID]
& ") AND" _
& "((tblAssociateActivities.ActivityDate)=#" & Format(TDate, "mm/dd/yy")
& "#));"
DoCmd.RunSQL StrSQL
End If
As always THANKS!