Conditionally Required fields

BuffaloTJ

New member
Local time
Yesterday, 22:23
Joined
Nov 5, 2009
Messages
2
I'm looking to conditionally require a field on a form. i.e., If Field A is populated, then make Field B required.

My VBA skills are minimal. I've searched the web a bit and haven't found anything useful. Any suggestions?

thanks in advance....oh, I'm using 07 for what its worth.
 
Extending Paul's example to your scenario:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Len(Me.FieldA & vbNullString) > 0 And Len(Me.FieldB & vbNullString) = 0 Then
  MsgBox "You need to fill out FieldB"
  Cancel = True
  FieldB.SetFocus
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom