Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2007

Tip: Looking for answers? Try searching our database.

form coding on before update

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
scott04 - 27 Nov 2007 20:12 GMT
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!
Ofer Cohen - 27 Nov 2007 20:39 GMT
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

Signature

Good Luck
BS"D

> 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
[quoted text clipped - 3 lines]
> in one or more of the three fields.  Can someone give me a push in the right
> direction?  Thank you!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.