I just noticed a strange thing happening in my database.
I have 2 data input forms that do not create new records but only update information in existing records.
The random thing happening is the code behind the forms is set to log the UserID in each record of the persons making the edits. There are 2 fields in the data table (tbl_auditdata) called LabInspectorUserID and VisualInspectorUserID where the userid values are stored for each record.
What I noticed is that randomly it will log the userid as a zero rather than their actual userid. It doesn't happen all the time either. A user could update 7 records and 2 of them would have a zero for their userid.
This database has been in use since mid 2015 and I noticed the first occurance of this happened at the end of April 2018 and I had not made any changes to the database for months before that.
This is the relevant code behind each form to update the above fields in the data table:
frm_labtestinput:
frm_visualinspectioninput:
I don't see how this is happening and maybe some code from the credentials module is necessary to show... anybody have any suggestions?
I have 2 data input forms that do not create new records but only update information in existing records.
The random thing happening is the code behind the forms is set to log the UserID in each record of the persons making the edits. There are 2 fields in the data table (tbl_auditdata) called LabInspectorUserID and VisualInspectorUserID where the userid values are stored for each record.
What I noticed is that randomly it will log the userid as a zero rather than their actual userid. It doesn't happen all the time either. A user could update 7 records and 2 of them would have a zero for their userid.
This database has been in use since mid 2015 and I noticed the first occurance of this happened at the end of April 2018 and I had not made any changes to the database for months before that.
This is the relevant code behind each form to update the above fields in the data table:
frm_labtestinput:
Code:
Private Sub UpdateRecord_Click()
Dim strMsg As String
blnGood = True
If (validate) Then
Me.Recordset.Edit
Me.Recordset.Fields("status").Value = "Complete"
Me.Recordset.Fields("LabInspectorUserID").Value = Credentials.UserId
Me.Recordset.Fields("LabUpdate").Value = Date
Me.Recordset.Update
If Me.CurrentRecord < Me.Recordset.RecordCount Then
Me.Recordset.MoveNext
Else
Me.Recordset.MoveFirst
End If
Else
strMsg = "All Fields are required."
Call MsgBox(Prompt:=strMsg, Title:="Before Update")
End If
blnGood = False
End Sub
frm_visualinspectioninput:
Code:
Private Sub Vis_Input_Submit_Click()
Dim strMsg As String
blnGood = True
If (validate) Then
Me.Recordset.Edit
Me.Recordset.Fields("status").Value = "Waiting On Lab"
Me.Recordset.Fields("VisualInspectorUserId").Value = Credentials.UserId
Me.Recordset.Update
If Me.CurrentRecord < Me.Recordset.RecordCount Then
Me.Recordset.MoveNext
End If
Else
strMsg = "All Fields are required."
Call MsgBox(Prompt:=strMsg, Title:="Before Update")
End If
blnGood = False
End Sub
I don't see how this is happening and maybe some code from the credentials module is necessary to show... anybody have any suggestions?