raghuprabhu
Registered User.
- Local time
- Today, 07:39
- Joined
- Mar 24, 2008
- Messages
- 154
Hi All,
The following is the code behind the click event of a button to close a modal form.
Basically
sSql = "UPDATE tblUpdatedOn SET tblUpdatedOn.updateDate = Date();" is not working. Is the syntex wrong?
It is working ok with
DoCmd.OpenQuery "qryUpdate", acViewNormal, acEdit
I don't like to use queries in the database. I use code behind the queries. Any help would be appreciated.
Thank you
Raghu Prabhu
Melbourne,
The following is the code behind the click event of a button to close a modal form.
Code:
Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click
Dim conn As ADODB.Connection
Dim sSql As String
' DoCmd.SetWarnings False
' DoCmd.OpenQuery "qryUpdate", acViewNormal, acEdit
' DoCmd.SetWarnings True
' DoCmd.Close
' Forms("frmMain").Form("subFrmUpdatedOn").Requery
sSql = "UPDATE tblUpdatedOn SET tblUpdatedOn.updateDate = Date();" '<<<<<< What is wrong with this sql code. It is not updating.
' Debug.Print sSql
Set conn = CurrentProject.Connection
conn.Execute sSql
Forms("frmMain").Form("subFrmUpdatedOn").Requery
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
Basically
sSql = "UPDATE tblUpdatedOn SET tblUpdatedOn.updateDate = Date();" is not working. Is the syntex wrong?
It is working ok with
DoCmd.OpenQuery "qryUpdate", acViewNormal, acEdit
I don't like to use queries in the database. I use code behind the queries. Any help would be appreciated.
Thank you
Raghu Prabhu
Melbourne,