form Required Field

Sed

Registered User.
Local time
Today, 13:11
Joined
Oct 16, 2008
Messages
111
Need help from the experts, On my table I have created a field and called it "US Domestic" and another field called it "Int'l Export". these two fields Data Type (Yes/No). I've created a query and created a form to brings those two fields in. However, if the "Int'l Export" is checked on the form, then I want to make another/respective field a required field. For example. If the check the "Int'l Export" then parts number is a required field and must be filled out. Else, these fields are not required field. Is possible?
 
For starters, I highly recommend taking the spaces and symbols (') out of your field names. You'll thank me later.

It seems to me that you don't need two fields. A shipment can either be domestic or international, so it would seem that one field would suffice. I would use one field for IntlExport. If it's checked it's international, otherwise it's domestic.

In any case, I'd use the before update event of the form:

Code:
If Me.Export = True Then
  If Nz(Me.PartNumber, "") = "" Then
    Msgbox "Must enter part number"
    Cancel = True
  End If
End If
 
Listen to Paul (he knows what he's talking about)

For starters, I highly recommend taking the spaces and symbols (') out of your field names. You'll thank me later.
Just wanted to put my 2 cents in on that. Do what Paul said - it will make your life easier and give you less headaches. If you don't do what he said about spaces and symbols, then prepare to have a difficult time and plenty of headaches.
 
Paul/Bob,

thank you very much. Advise well taken. I will make changes.
 

Users who are viewing this thread

Back
Top Bottom