Search results

  1. T

    Max function in VBA?

    If found this function, which seems to do the trick, here: http://groups.google.com/group/comp.databases.ms-access/browse_thread/thread/b3c41e139bad90df/187ae6b7650837a7?lnk=gst&q=max+function&rnum=1#187ae6b7650837a7 Public Function ListMax(ParamArray ListItems() As Variant) Dim I As...
  2. T

    Max function in VBA?

    Thanks. I'm looking for something that does this (in vba): max(number1, number2, number3, etc) But it appears that the Access max does this: max(field1) It doesn't even do this: max(field1, field2, field3) Is this correct?
  3. T

    Max function in VBA?

    I guess there's no Max (or Min) function in VBA. Is there a simpler way to do the following, which would greatly benefit from a max function? Thanks. Option Compare Database Option Explicit Public Function PF(Distance_Feet As Variant, HF1Adj As Variant, HF2Adj As Variant, HF3Adj As Variant...
  4. T

    Trouble converting nulls to zeroes using Nz()

    The posted function has variant type because it didn't work with double or single. The function below produces the same error as the above function when a null value is passed. It accepts everything except a null value. Public Function ZEROtest(NullTest As Double) As Double ZEROtest =...
  5. T

    Trouble converting nulls to zeroes using Nz()

    Yes, "and" is what I mean, but for some reason I put "or" in when writing the function, and since it seemed to work, I didn't change it. (Changing it does not solve the Nz problem.) My problem is that the function does not handle null values. If you put nulls in as arguments in the immediate...
  6. T

    Trouble converting nulls to zeroes using Nz()

    Thanks for the reply. When I enter null values in the immediate window, the code isn't highlighted, so I can't say exactly where it's going wrong. But Nz is not causing the error, which occurs even without Nz. I added the Nz function hoping to solve the problem. I got around the error by using...
  7. T

    Trouble converting nulls to zeroes using Nz()

    My function works except when either of two arguments, Frac_5_PARtbl or Frac_5, pass null values. If the nulls are changed to zeroes, the function works, so I've tried using the Nz() function to change the nulls to zero, but without success. The error in the immediate window is "compile error...
Back
Top Bottom