troubleshooting Question

ms access error handling

Avatar of deefel
deefel asked on
Microsoft Access
5 Comments1 Solution256 ViewsLast Modified:
I keep getting a runtime error of 94 when I make the first select in the code below. How  do I create a error handle to capture null value or blank values.

Private Function calculateTotal(v1, v2)
    Dim iTier1 As Integer  ' number in control name for units sold controls - Tier1, Tier2, ...
    Dim iTier2 As Integer
    Dim cGSAR As Currency ' total per line
    Dim i As Integer 'counter for lines considered

THIS IS WHERE I BELIEVE I GET THE ERROR - I am making the first selection from combox.
    iTier1 = Right(v1, 1) ' gives 1 for US1, 2 for US2 and so on
    iTier2 = Right(v2, 1)
    cGSAR = 0
    For i = iTier1 To iTier2
        cGSAR = cGSAR + Me.Controls("Tier" & i)
    calculateTotal = cGSAR
End Function
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros