[AccessD] Select Multiple records on form

A.D.TEJPAL adtp at hotmail.com
Tue May 16 09:25:10 CDT 2006


Mark, Gustav,

    1 - Comments on points raised by Gustav:
        1.1 - Change of status requiring re-rendering of colors on controls governed by conditional formatting involves slight time lag, though in simplest of cases it may hardly be noticeable. 
        1.2 - The phenomenon gets further accentuated when max allowed limit of three format conditions is fully exploited, and the expressions used therein are not merely verifying the status of a particular record but are dependant upon user defined functions dealing with recordsets.
        1.3 - Block-size involved (number of cells i.e. rows x columns), for which re-rendering of colors is to be implemented, also contributes to time lag. Overall number of records in form's record source also has a bearing, as each record needs to be tested against the condition even if it does not qualify for application of color.
        1.4 - For dynamic formatting at run time, editing the expression / color / font of existing condition visa-vis application of brand new condition is not found to provide any advantage in respect of time lag discussed above. On the other hand, with edit approach, the revision does not take effect unless refresh action is also performed on the form. 
        1.5 - For the present case, involving conditional formatting of selected block of records on a continuous form (Access 2000 file format), performance of dynamic conditional highlighting is found to be much better in Access 2003 installation, where the status change gets implemented in just a flicker. In case of Access 2K & XP installations, the time lag is found to be significantly more noticeable.

    2 - Comments on points raised by Mark:
        2.1 - When you drag the mouse over record selectors for multiple selection, form's click event fires only after the mouse button is finally released on reaching the last selected record. It is this click event that sets up revised conditional formatting of records falling in the selected block.
        2.2 - Fn_SelectedBlock() is used by the expression in format condition and verifies whether the given record falls in currently selected block. It takes primary key number as its argument and returns 1 if true, otherwise zero. AS explained in para 2.1 above, Fn_SelectedBlock() comes into play only after the mouse button is finally released on reaching the last selected record.
        2.3 - In one of your posts, you stated that you also wish to keep track of non-contiguous selected records. Non-contiguous records can not simultaneously form part of a given block of current selection. Perhaps you want to keep track of all previously selected records, even those not falling in current selection block. If so, this can be done.
        2.4 - My sample db ContFormsKeyNavAndHighLightMultiSelect, covers this requirement and should become available at Rogers Access Library shortly. It features:
        (a) Key Navigation (Datasheet Style)
        (b) Graded Highlighting Of Multiple Selected Records identifying:
             (i)   Current record
             (ii)  Current selection block
             (iii) Other records, selected any time earlier in current session
             Note - Primary key numbers of all selected records (whether forming part of current block or not) are stored in a form level global variable.

Best wishes,
A.D.Tejpal
---------------

  ----- Original Message ----- 
  From: Mark A Matte 
  To: accessd at databaseadvisors.com 
  Sent: Monday, May 15, 2006 23:11
  Subject: Re: [AccessD] Select Multiple records on form


  Gustav,

  Thanks for the compliment.  As I started going through the code line by line...it got more confusing.  Apparently the function "Fn_SelectedBlock" goes through each control...but 1 record at a time.  

  The thing is if you are stepping through the code...when it gets to where it calls "Fn_SelectedBlock"...it does NOT go there...it just continues on...then when you get to the end of the code(hit F8 1 last time on END SUB)...it zips through the function"Fn_SelectedBlock", without breaking.

  This code, in my opinion, is doing something very 'cool'...almost what I need...but just out of my understanding.

  Thanks,

  Mark A. Matte


  >From: "Gustav Brock" <Gustav at cactus.dk>
  >Reply-To: Access Developers discussion and problem 
  >solving<accessd at databaseadvisors.com>
  >To: <accessd at databaseadvisors.com>
  >Subject: Re: [AccessD] Select Multiple records on form
  >Date: Mon, 15 May 2006 18:53:48 +0200
  >
  >Hi Mark and A.D.
  >
  >Sorry A.D. - didn't notice that. You normally know very well what you are doing but this With .Add(..) thingy looks strange to me.
  >It may be perfectly OK ... but 3 seconds?
  >
  >/gustav
  >
  > >>> markamatte at hotmail.com 15-05-2006 18:39 >>>

  >Gustav,
  >
  >A.D.Tejpal sent this code...I hate to admit...but I don't quite understand.I've tried to step through the code...but it doesn't do the
  >"Fn_SelectedBlock" part until after I finish stepping though( I can 
  >actually see the VBA window "zip" through that function...after it appeard to be done) if that makes any sense???...and in all honesty I'm not sure what to change.
  >
  >Thanks,
  >
  >Mark A. Matte
  >
  > >From: "Gustav Brock" <Gustav at cactus.dk>
  > >Reply-To: Access Developers discussion and problem
  > >solving<accessd at databaseadvisors.com>
  > >To: <accessd at databaseadvisors.com>
  > >Subject: Re: [AccessD] Select Multiple records on form
  > >Date: Mon, 15 May 2006 18:30:29 +0200
  > >
  > >Hi Mark
  > >
  > >      With Me(ControlName).FormatConditions
  > >        .Delete
  > >         Cdn = "Fn_SelectedBlock(ID) <> 0"
  > >         With .Add(acExpression, , Cdn)
  > >           .BackColor = 16777164
  > >           .FontBold = True
  > >         End With
  > >      End With
  > >
  > >That code looks clunky to me. Did you try changing it to something that
  > >specifically Set a FormatCondition object, then adjusts properties
  > >BackColor and FontBold of this?
  > >
  > >/gustav


More information about the AccessD mailing list