Can you post a zip copy of your database? Only a few records to show the error.
Update
I created a form with 2 textboxes.
txtbx1 NoInFull
txtbx2 text2 ( need to move to this so that the before update on NoInFull is executed)
I modified the code a littleand revised again to include >0 check)
Code:
' ----------------------------------------------------------------
' Procedure Name: NoInFull_BeforeUpdate
' Purpose: To show some validation of a text box using the BeforeUpdate event.
' Procedure Kind: Sub
' Procedure Access: Private
' Parameter Cancel (Integer): Textbox whose value is to be validated.
' Author: Jack
' Date: 11-Jun-20
'
'NOTE: The validation could be done in the Forms' BeforeUpdate also
'especially is there were multiple control validating to be done.
' ----------------------------------------------------------------
Private Sub NoInFull_BeforeUpdate(Cancel As Integer)
10 If IsNull(Me.NoInFull) Then
20 Debug.Print "NULL value in NoInFull"
30 ElseIf Len(Me.NoInFull) = 0 Then
40 Debug.Print "There was no value supplied for NoInFull"
50 ElseIf Not IsNumeric(Me.NoInFull.Value) Then
' MsgBox "My message box for numeric.", vbOKOnly
60 Debug.Print "Value <" & Me.NoInFull & "> in NoInFull is NOT numeric "
70 Cancel = True
80 Me.NoInFull.Undo
' DoCmd.GoToControl "NoInFull" '''...This when active gives error 2108
90 ElseIf Me.NoInFull = 0 Then
100 Debug.Print "Value <" & Me.NoInFull & "> in NoInFull must be greater than 0"
110 Else
120 Debug.Print "Value <" & Me.NoInFull & "> in NoInFull is numeric "
130 End If
End Sub
Sample results from the debug.print statements:
Value <12345> in NoInFull is numeric
Value <Abcde> in NoInFull is NOT numeric
Value <-234> in NoInFull is numeric
NULL value in NoInFull
Value <234> in NoInFull is numeric
Value <0> in NoInFull must be greater than 0
Value <137340> in NoInFull is numeric
NULL value in NoInFull
Value <abcdw> in NoInFull is NOT numeric
Note: The only way I could get a NULL value into NoInFull was to type a few characters, then delete them all and go to text2.
Your line
Code:
' DoCmd.GoToControl "NoInFull" '''...This when active gives error 2108
gave me an error 2108 before I made it a comment.