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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Divide by Zero Access Error 1

Status
Not open for further replies.

perrdl

Technical User
Sep 11, 2001
5
0
0
GB
I am using Microsoft Access 2000 to design a database in which data is entered into a form. I then perform calcutations on this data, but if zero is entered into a field I am trying to divide by, the result is populated with Error.

Is there any way that I can turn this off and simply poulate with zero, rather than producing an error message.

Thanks
Darren
 
Populate the result with Zero if the text box that has the value that causes the error has a zero in it


Private Sub YourCommandButton on_click
If me.txtYourTextBox = 0 then
me.txtResult = 0
Else
me.txtResult = me.txtNumerator/me.txtYourTextBox
End Suv Tyrone Lumley
augerinn@gte.net
 
This is exactly what I was after, ChrisBurch

Thanks a lot!!!
Daz
 
Daz,

For MS Access issues/queries you would be much better subscribing to the 'Microsoft: Access - General Discussion' forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top