Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to do error check on expressions

Status
Not open for further replies.

Keving74

Technical User
Nov 6, 2001
7
US
How do prevent getting an error message in a field when the field contains an expression that has a division by zero. The expression is " [start3]/([# Of Hours Worked3]/8)" Whenever "Of Hours Worked3" is zero, I get the error message "#Error" in the field. Someone recomended an error check but I am not familiar with visual basics. Any help will be greatly appreciated.
 
You are going to need to test that field using both an IIF and the NZ function. They are both in help and that should be enough to get you going in the right direction. If not, post back and we can help more... Terry M. Hoey
 
Terry

The form is generated by a query, I have tried the Nz function before and it did not work.

Going back to the expression " [start3]/([# Of Hours Worked3]/8)" all these fields are kept in a table and already have zeros in them before data entry, so if no data is entered it will remain zero. I was thinking of maybe some form of code to place in the after update property. If there is an easier way please let me know

Thanks Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top