how to make a field required once data is entered into a seperate field

skp

Registered User.
Local time
Yesterday, 16:10
Joined
Feb 28, 2011
Messages
21
Field A
Field B

I am trying to make it so that when data is entered into field A then field B becomes required, if no data is entered into A then B is not required. Any help would be appreciated. I am using 2003.
 
You can do this on a form not direct in a table and you can use either a VBA IF statement or Case Statement.
 
Ok, so I got it to require Field B if there is data in Field A using if statements.* But now, if I do not have any information in either field, the close button becomes inactive.* Here is what my code is looking like.
*
Private Sub cmdClose_Click()
*** If Me.CloseDt >= 0 Then
******* If IsNull(Me.Comments) Then
*********** MsgBox "You must leave a comment."
*********** Me.Comments.SetFocus
******* Else
*********** DoCmd.Close
******* End If
*** End If
End Sub
 
Found the problem, I was focusing on the Exit button when I needed to focus on field B. Thanks
 

Users who are viewing this thread

Back
Top Bottom