Re: Who yields - client or developer? Your opinion

From: Marshall Barton <marshbarton_at_mindspring.com>
Date: Tue, 04 Jun 2002 17:14:05 -0500
Message-ID: <joeqfus9cjs4hj68s6v2ophrek7c5p9se9_at_4ax.com>


Graham Bellamy wrote:

>Excellent. Thank you. Works a treat. Even the aircode worked without having to change
>anything. Adding a simple error handler to prevent code-breaks for div/0 and null values
>is good enough for me for now (handler returns CalcQR="#Error"). (If data entry occurs via
>the query, it recalcs on every change of field, and doesn't wait for the record to be
>fully filled-in and saved, which ends up trying to calculate formulas with null values.)
>
>Thank you for your help.
>Graham

Great! That sort of stuff is rarely useful, but when you need it ...

Glad it solved your problem,

-- 
Marsh
MVP [MS Access]



>"Marshall Barton" <marshbarton_at_mindspring.com> wrote in message
>news:gnckfusgrnf9squg04t6urs90ahv6bpb9d_at_4ax.com...
>> Here's my A97 variant of Replace:
>>
>> Function Subst(Original As Variant, Search As String, _
>> Replace As String) As Variant
>> Dim pos As Long
>>
>> Subst = Original
>> If IsNull(Subst) Then Exit Function
>> If Len(Search) > 0 Then
>> pos = InStr(Subst, Search)
>> Do Until pos = 0
>> Subst = Left(Subst, pos - 1) & Replace _
>> & Mid$(Subst, pos + Len(Search))
>> pos = InStr(pos + Len(Replace), Subst, Search)
>> Loop
>> End If
>> End Function
>>
>> The A2K wrapper function is just a one line call to the
>> built in Replace.
>>
>> If you want to create a function to do your specific three
>> replace operations with a single call (probably a good idea)
>> then, off the top of my head, I would think, depending on
>> the details of your specific needs, it would be something
>> like this air code:
>>
>> Public Function CalcQR(Original As Variant, _
>> A As Variant, R As Variant, T As Variant) As Variant
>> Dim strExp As String
>> strExp = Subst(Original, "[Area]", Nz(A, ""))
>> strExp = Subst(strExp, "[Rate]", Nz(R, ""))
>> strExp = Subst(strExp, "[Thickness]", Nz(T, ""))
>> CalcQR= Eval(strExp)
>> End Function
>>
>> And then the query field would be:
>>
>> QtyRate: CalcQR(QtyFormula, [Area], [Rate], [Thickness])
Received on Wed Jun 05 2002 - 00:14:05 CEST

Original text of this message