-----Original Message-----
You would use the BeforeUpdate events to test for this and stop it:
Private Sub MRC_BeforeUpdate(Cancel As Integer)
If Len(Me.OTC.Value & "") > 0 Then
MsgBox "A value has already been entered in OTC." & _
" You cannot enter a value here, too.", vbExclamation, _
"Entry Not Allowed!"
Cancel = True
Me.MRC.Undo
End If
End Sub
Private Sub QRC_BeforeUpdate(Cancel As Integer)
If Len(Me.OTC.Value & "") > 0 Then
MsgBox "A value has already been entered in OTC." & _
" You cannot enter a value here, too.", vbExclamation, _
"Entry Not Allowed!"
Cancel = True
Me.QRC.Undo
End If
End Sub
Private Sub OTC_BeforeUpdate(Cancel As Integer)
If Len(Me.MRC.Value & "") > 0 Then
MsgBox "A value has already been entered in MRC." & _
" You cannot enter a value here, too.", vbExclamation, _
"Entry Not Allowed!"
Cancel = True
Me.OTC.Undo
ElseIf Len(Me.QRC.Value & "") > 0 Then
MsgBox "A value has already been entered in QRC." & _
" You cannot enter a value here, too.", vbExclamation, _
"Entry Not Allowed!"
Cancel = True
Me.OTC.Undo
End If
End Sub
--
Ken Snell
<MS ACCESS MVP>
I need help in coding with 3 field I have [MRC],[QRC] and
[OTC].
If [MRC] or [QRC] has a value entered and someone tries
to enter a value in [OTC] or if you have a value in
[OTC] and try to enter a value in [MRC] or [QRC] I need
a message box that says "You can not have a [ORC] and
you can have [MRC] or [QRC] and vice versa.
Thank you in advance.
Raj
.