Make data entry required in one field if another field is entered.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two fields in a form, Supplier Code and Date issued. If a user enters
data in the Supplier Code field, they must enter a date in Date issued. How
do I do this? With a macro? I know this must be simple and I'm probably
over complicating the problem.
 
If the suppliers textbox name is "Supplier"
and you date textbox is "DateDone"
Try

'put this in the "Suppliers" afterupdate event
Me.DateDone.SetFocus

'put this in the "DateDone" onexit event
If IsNull(Me.DateDone) or Me.DateDone = "" Then
MsgBox "Please Enter a Date"
Me.DateDone.Setfocus
End If

That should force them to enter a date.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top