I am not good with code, so could someone please help me with some "If" and "Then" code to avoid and error? The bit of code that I am going to post works fine unless the escape button is pressed or the enter button is pressed without and entry. I know the path that I would like it to take, I just don't know how to write the code. The code is from a text field on a form.
Thanks,
Private Sub metallicZn_Enter()
Dim Tarewt As Double
Dim Totalwt As Double
Dim Samplewt As Double
Dim tmpZn As Double
Dim dbs As Database
Set dbs = CurrentDb()
Tarewt = InputBox("Enter the screen tare weight", "metallicZn")
Totalwt = InputBox("Enter the tare weight plus sample", "metallicZn")
Samplewt = InputBox("Enter the sample weight", "metallicZn")
tmpZn = (Totalwt - Tarewt) / Samplewt * 100
metallicZn = tmpZn
'Rb 11/16/06
ENDSUB:
Thanks,
Private Sub metallicZn_Enter()
Dim Tarewt As Double
Dim Totalwt As Double
Dim Samplewt As Double
Dim tmpZn As Double
Dim dbs As Database
Set dbs = CurrentDb()
Tarewt = InputBox("Enter the screen tare weight", "metallicZn")
Totalwt = InputBox("Enter the tare weight plus sample", "metallicZn")
Samplewt = InputBox("Enter the sample weight", "metallicZn")
tmpZn = (Totalwt - Tarewt) / Samplewt * 100
metallicZn = tmpZn
'Rb 11/16/06
ENDSUB: