[AccessD] Max of 20 values

jwcolby jwcolby at colbyconsulting.com
Sat Jul 23 09:19:14 CDT 2011

So you are saying that every single control needs data entered into it?

John W. Colby

On 7/23/2011 10:12 AM, Arthur Fuller wrote:
> 1. Pls forgive me my senior moments, JC.
> 2. You're such a classy guy, I just knew you'd come up with a set of
> classes.
> The problem is perhaps in the UI rather than the logic. So far, there is no
> prevention upon the user entering M1 then M3 then M20 and leaving all the
> others out. Granted, this style of data-entry doesn't make sense, but given
> user-sensibilities (the newly politically correct way to phrase Dumbass
> MoFo), I need to guard against such ostensibly intelligent responses to my
> form. I suppose that one possibility is in each AfterUpdate, force the Focus
> to the next in sequence.
> All that said, I shall work on implementing your approach. I just imported
> your code and aside from a couple of vbcrlfs if worked fine. The part I
> don't like is the specific reference to the active control. I have looked at
> ActiveControl and maybe that's the path I should follow. I want to compress
> this into one clean function that receives the currently active control and
> the currently defined maximum, and then reset the MaxGroupReading to the
> greater of these two values, so I can copy+paste said "=ComputeMax()" into
> all 20 of the AfterUpdate events and be done with it.
> Your last comment (about passing in the form) has immediate potential. In
> the real case, I have to do this four times, with fields numbered M1..M20,
> M21..M40, M41...M60 and M61...M80. Each of these lives on a separate tab's
> subform, but the algorithm remains the same throughout. There may or may not
> be data on everything beyond M20, as defined by the Parent form. If a
> WorkStation has only two LightCurtains, then LC1 and LC3 are defined with
> measures, and the others are not. (Please don't ask me why the sequence goes
> LC1, LC3, LC2 and LC4 -- I'm just a grunt programmer in the trenches, not a
> certified P.Eng). I just do what I'm told... which argument didn't work at
> Nuremberg and perhaps won't pass in Toronto, but that's my argument and I'm
> sticking to it.
> A.
> On Sat, Jul 23, 2011 at 9:46 AM, jwcolby<jwcolby at colbyconsulting.com>wrote:
>> Bubble sort?
>> Arthur!!!
>> I think a set of classes... ;)
>> Actually a simple function where you pass the control with the data just
>> entered and the MaxReading control.  The function compares the value just
>> entered with max reading and sets maxreading to the new value if the new
>> value is bigger.
>> function SetMaxReading(ctlJustEntered as control, ctlMaxReading as control)
>>         if ctlJustEntered.Value>  ctlMaxReading.value then
>>                 ctlMaxReading.value = ctlJustEntered.Value
>>         endif
>> end function
>> If you need to set dirty false then pass in the form as well.
>> John W. Colby
>> www.ColbyConsulting.com

More information about the AccessD mailing list