businesshippieRH
Registered User.
- Local time
- Today, 17:12
- Joined
- Aug 8, 2014
- Messages
- 60
I'm trying to figure out the proper syntax for this SQL statement, but have hit a wall (and: No. More coffee did not help). Any help would be great! Thanks!
Code:
Private Sub btn_Cancel_Click()
'Turn warnings off
DoCmd.SetWarnings (WarningsOff)
'Run Append Query for Canceling Document
'Set Strings so that SQL works properly
Dim CancelNotes As String
CancelNotes = "This record was canceled prior to completing information entry."
Dim TodayDate As String
TodayDate = Format(Date, "MM/DD/YYYY")
DoCmd.RunSQL "INSERT INTO tbl_Records (CancelDate, CancelNotes)" & _
"SELECT " & TodayDate & "AS Expr1, " & CancelNotes & "AS Expr2" & _
"WHERE [Tables]![tbl_Records]![RecordName] = [Forms]![frm_NEWRecord]![txt_RecordName];"
'Turn warnings back on
DoCmd.SetWarnings (WarningsOn)
'Close the Form
DoCmd.Close acForm, "frm_NEWRecord"
End Sub