form coding on before update

  • Thread starter Thread starter scott04
  • Start date Start date
S

scott04

Hi everyone. I have a yes/no field on my form with 3 number fields related
to the the yes/no form. If the the yes/no form is True then i would like at
least one of the three number fields to have a number greater than 0. I have
it set so that if the yes/no is false it automatically sets the three number
fields to 0 but i am trying to set a rule that forces you to enter a number
in one or more of the three fields. Can someone give me a push in the right
direction? Thank you!
 
You can use the form BeforeUpdate event to check if the fields are filled, if
not then stop the process

If Me.[CheckBoxName] = True And (Nz(me.[TextBox1],0) + Nz(me.[TextBox2],0)
+ Nz(me.[TextBox3],0) = 0) then
MsgBox "You need to apply a number"
Cancel = True ' Stop the process
End If
 

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