[AccessD] Select Multiple records on form

A.D.TEJPAL adtp at hotmail.com
Tue May 16 11:42:36 CDT 2006


Mark,

    So long as the group of records remain in a selected state, and after you have released the mouse button, the code provided by me earlier, ensures continued highlighting of such records in a special color, till the selection gets undone (e.g. user clicking on any control).

    For your ready reference, selection of records is done as follows:
        (a) Single record - Click on record selector.
        (b) Multiple records at a time - Click on record selector of top desired record and drag the mouse to record selector of bottom desired record. (Alternatively, you can hold down shift key and then click the record selector for bottom desired record, or use Dn Arrow key to expand the selection suitably).   
        Note - Using Up/Dn arrow keys alone, when a group of records is already in selected state, moves the whole selection mask accordingly.

    Apparently, something might be amiss in actual implementation of suggested solution at your end. It might be helpful to look at the sample db mentioned in my previous post. It is in Access 2000 file format and is working smoothly on Access 2003 installation. On Access 2K, time lag is encountered as stated earlier, but results are consistent.

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

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


  Thanks A.D

  With the code you sent...when I click on a record...was it supposed to stay selected?  or was the form supposed to return to its original state on its own?

  The 3 seconds referred to wasn't a 'lag' as much as the duration of the 
  formatting.  The selection only lasted that long.  If I used a shorter 
  recordset...I didn't see the formatting at all.

  Thanks,

  Mark A. Matte


  >From: "A.D.TEJPAL" <adtp at hotmail.com>
  >Reply-To: Access Developers discussion and problem 
  >solving<accessd at databaseadvisors.com>
  >To: "Access Developers discussion and problem 
  >solving"<accessd at databaseadvisors.com>
  >CC: ADT <adtp at airtelbroadband.in>
  >Subject: Re: [AccessD] Select Multiple records on form
  >Date: Tue, 16 May 2006 19:55:10 +0530
  >
  >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


More information about the AccessD mailing list