madatory fields

emmily11

Registered User.
Local time
Today, 15:47
Joined
Mar 31, 2003
Messages
18
hi i am wondering if anyone can help i am creating a database with
delivery address,
a check box called "delivery = invoice" and invoice address

i want the invoice address field to be madatory only when the check box insnt ticked

i would also like the box to be deactivated on a form and maybe change colour if check box is ticked

thanks for all your help
emmily
 
emilly,

In the BeforeUpdate event of your form, you can put

Code:
If Me.CheckBox = False Then
   MsgBox("You must enter a value in ...")
   Me.ThatField.SetFocus
Else
   Me.ThatField.BackColor = 12345
End If

I don't have Access with me so I don't know if the
.BackColor is the property you need.

hth,
Wayne
 
sorry

hi sorry for posting on the different forums i didnt know what section to put it in where me. should i put the name of the database or should i put me. thanks
 
sorry

hi sorry for posting on the different forums i didnt know what section to put it in where me. should i put the name of the database or should i put me. thanks
 
Me refers to the form that the code is in, so you do need Me and not the name of the database.
 

Users who are viewing this thread

Back
Top Bottom