simeon_rose
Registered User.
- Local time
- Today, 03:33
- Joined
- Nov 4, 2000
- Messages
- 34
hi i've got a form with a textbox on it showing Dmax result from an unrelated table. i've also got another textbox on the same form into which i want the user to enter the output given in the Dmax textbox. when the user doesn't do this, i've set up an error message in the before update event but this is then immediately followed by run time error 2115 rather than just resetting the focus to the ID textbox. this is the code that i've used:
Private Sub ID_BeforeUpdate(Cancel As Integer)
If Me.ID <> Forms!frmtblcar!Text17 Then
MsgBox "Incorrect Entry, You should enter " & Forms!frmtblcar!Text17, 0, "Error"
Me.ID = ""
Me.ID.SetFocus
End If
End Sub
could somebody please point me in the right direction?
p.s: i've tried putting the code in other events, but invariably there are other problems with this.
Private Sub ID_BeforeUpdate(Cancel As Integer)
If Me.ID <> Forms!frmtblcar!Text17 Then
MsgBox "Incorrect Entry, You should enter " & Forms!frmtblcar!Text17, 0, "Error"
Me.ID = ""
Me.ID.SetFocus
End If
End Sub
could somebody please point me in the right direction?
p.s: i've tried putting the code in other events, but invariably there are other problems with this.