Good morning everyone,
This is a general question for more advanced users of Access. In some of our forms we use Update SQL statements instead of using update queries in an effort to save a little space in the database (I know it seems negligible, but I thought it would be more efficient this way rather than making and calling an entire query). Recently, we've experienced some data corruption issues in one of our databases and now I am paranoid about doing anything that directly changes values in a table like this. Has anyone ever experienced data corruption when running a sql statement in code? I'll give a small example of what I'm referring to:
Private Sub cmdOk_Click()
On Error GoTo Err_cmdOk_Click
dim strSQL as String
dim strDocName as string
strDocName as "DocName"
strSQL = "UPDATE dbo_Table set FieldValue=0 WHERE Value= '" & Me.txtValue & "'
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
Exit_cmdOk_Click:
Exit Sub
Err_cmdOk_Click:
MsgBox Err.Description, vbInformation
Resume Exit_cmdOk_Click
End Sub
This is not exactly what the code does but I wanted to keep it basic just to give a general idea of what I'm talking about. Thank you in advance.
By the way, the table being updated does not exist exclusively in Access but is on a server. This Access database is also used by multiple people, but the particular function is only accessible to a few.