Private Sub Form_BeforeUpdate(Cancel As Integer)
If OEDetailDirty Then
If Nz(Me.SPECIESCODE, "") = "" Then
Cancel = True
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Me.SPECIESCODE.SetFocus
End If
End If
If Not Me.NewRecord Then
Me.ModifiedBy = Form_Switchboard.txtUser
Me.ModificationDateTime = Now()
End If
End Sub

Private Sub Form_Close()
rsTest.Close
Me.Refresh
If OEDetailDirty Then
If Nz(Me.SPECIESCODE, "") = "" Then
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Me.SPECIESCODE.SetFocus
Else
DoCmd.Hourglass True
If DCount("[CountOfBottomTestID]", "qryOverlappingResultLines") <> 0 Then OEVerifyReqDetail Me.AccessionNumber
OEMakeLabResults Me.AccessionNumber
OEDetailDirty = False
DoCmd.Hourglass False
End If
End If
End Sub

Private Sub SPECIESCODE_BeforeUpdate(Cancel As Integer)
If Nz(Me.SPECIESCODE, "") = "" Then
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Cancel = True
Else
If Me.REQDETAIL_subform.Form.Recordset.RecordCount > 0 Then
If Me.SPECIESCODE.OldValue <> Me.SPECIESCODE.Value Then OEDetailDirty = True
End If
End If
End Sub

Cancel = False
If OEDetailDirty Then
If Nz(Me.SPECIESCODE, "") = "" Then
Cancel = True
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Me.SPECIESCODE.SetFocus
Else
Me.Refresh
If DCount("[CountOfBottomTestID]", "qryOverlappingResultLines") <> 0 Then OEVerifyReqDetail Me.AccessionNumber
OEMakeLabResults Me.AccessionNumber
OEDetailDirty = False
End If
End If
If Not Cancel Then
Me.txtAccessionNumber = Format(Val(Right$(Me.AccessionNumber, Len(Me.AccessionNumber) - 1)) + 1, "00000000")
txtAccessionNumber_AfterUpdate
End If

Cancel = False
If OEDetailDirty Then
If Nz(Me.SPECIESCODE, "") = "" Then
Cancel = True
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Me.SPECIESCODE.SetFocus
Else
Me.Refresh
If DCount("[CountOfBottomTestID]", "qryOverlappingResultLines") <> 0 Then OEVerifyReqDetail Me.AccessionNumber
OEMakeLabResults Me.AccessionNumber
OEDetailDirty = False
End If
End If
If Not Cancel Then
DoCmd.GoToRecord , , acPrevious
Me.txtAccessionNumber = Me.AccessionNumber
End If

Cancel = False
If OEDetailDirty Then
If Nz(Me.SPECIESCODE, "") = "" Then
Cancel = True
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Me.SPECIESCODE.SetFocus
Else
Me.Refresh
If DCount("[CountOfBottomTestID]", "qryOverlappingResultLines") <> 0 Then OEVerifyReqDetail Me.AccessionNumber
OEMakeLabResults Me.AccessionNumber
OEDetailDirty = False
End If
End If
If Not Cancel Then
DoCmd.GoToRecord , , acFirst
Me.txtAccessionNumber = Me.AccessionNumber
End If

Cancel = False
If OEDetailDirty Then
If Nz(Me.SPECIESCODE, "") = "" Then
Cancel = True
MsgBox "The species must be entered to set the test normal ranges!", vbApplicationModal + vbExclamation, "Species Missing"
Me.SPECIESCODE.SetFocus
Else
Me.Refresh
If DCount("[CountOfBottomTestID]", "qryOverlappingResultLines") <> 0 Then OEVerifyReqDetail Me.AccessionNumber
OEMakeLabResults Me.AccessionNumber
OEDetailDirty = False
End If
End If
If Not Cancel Then
DoCmd.GoToRecord , , acLast
Me.txtAccessionNumber = Me.AccessionNumber
End If

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Thats alot of code to check can you pin point where it fails?, the problem could be with the sql login itself to rule this out can to update data on the form? if not your either missing a primary key or the login the database is using does not have permission to write to the database.

This is the code that causes the error. I have checked and triple checked the permissions to the data. It seems ok because other form in the databse work fine. I have a feeling that it may be an issue with the way the SQL code is attempting to write to the database. This front-end is currently in production and works fine with an Access Back-end.

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…