I am trying to update a table
It is tbl_incident
from data on a form called frm_edit
I am using the following code, and instead of changing only the information that corresponds to the Date_of_Incident , it is changing all entries in tbl_incident that have the badge number. I am stumped as this was working perfectly until I had an issue and the database got corrupted. I had to rebuild it and now it no longer works.
If I haven't given you enough info please ask. I am a little flustered right now.:banghead::banghead:
It is tbl_incident
from data on a form called frm_edit
I am using the following code, and instead of changing only the information that corresponds to the Date_of_Incident , it is changing all entries in tbl_incident that have the badge number. I am stumped as this was working perfectly until I had an issue and the database got corrupted. I had to rebuild it and now it no longer works.
Code:
"Dim strSQL As String
strSQL = "UPDATE tbl_incident SET tbl_incident![Description] = Forms!frm_edit![Description], tbl_incident![Code] = Forms!frm_edit![Code] ,tbl_incident![Points] = Forms!frm_edit![points]" _
& "WHERE tbl_incident![Badge] = Forms!frm_edit![Badge] AND tbl_incident![Date_of_Incident] = Forms!frm_edit![Date_Of_incident]"
If Me.Dirty Then Me.Dirty = False
DoCmd.RunSQL (strSQL)"
Last edited: