After the above didn't seem to work, along with numerous
other attempts, I eventually cobbled together something on
the Exit event for the subform control that I want the
validation on. I don't like that much, as it seems, well,
inelegant (probably not very foolproof), but it seems to
work, so far.

Note that Microsoft no longer maintains this forum, and there are only a very
few folks monitoring it.

John W. Vinson

Well, neither the Enter nor Exit event are ideal for what you are trying to
accomplish. They both fire if you are simply tabbing through the controls on
the form not doing anything at all.

If you want to conditionally set the Validation Rule property of a form
control (which, by the way, I never use!) then the form's Current event would
be the best choice. But my preference would be to use the subform's Form (not
the Control's) BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Parent!cboMain = 2 Then
If Len(Me!txtSub & "" ) = 0 Then
Cancel = True
MsgBox "You need to put something into txtSub!", vbOKOnly
Me!txtSub.SetFocus
End If
End if
End Sub
--

That's were I wound up when still trying to set the
Control's Validation Rule, but it never worked. Even just
setting the validation rule manually in the control's
properties didn't work--even when the record was dirty, it
let me sail on thru that field without a murmur--it only
yelled at me if I first entered something and then tried to
delete it.

But my preference would be to use the subform's Form (not
the Control's) BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
If Parent!cboMain = 2 Then
If Len(Me!txtSub & "" ) = 0 Then
Cancel = True
MsgBox "You need to put something into txtSub!", vbOKOnly
Me!txtSub.SetFocus
End If
End if
End Sub