Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2

    Answered: 'Shift' versus 'Ctrl' and the issues incurred and how to overcome

    I have yet another interesting problem that I am requesting some great Brilliant Database support. There is one part of my project where I am removing various people's files from the program. These individuals are flagged using a 'flag (yes/no) field' on their record. When the script starts, it shows all people that are flagged with a yes (checkbox is checked) - see attachment 1. Next, the user select an individual OR several people's files to remove as the 'Recordset=Input from a folder' is set for 'No limitation'. This all works well providing that when the user selects multiple people that the 'Ctrl' key is held. If the 'Shift' key is held during this step, rather than just deleting the people selected, the program deletes all other people that fall alphabetically between people selected... even those that did NOT appear on the 'Recordset=Input from folder'. I have added a label on the menu that states "Do NOT use the 'Shift' key', however, I would like to totally eliminate the 'Shift' key being used (in my opinion, it should never even do this but it is what it is???).

    For example, if I select Caldwell, Matt and Gannon, Roan from the list while holding the 'Ctrl' key, the program deletes only those records associated with those two individual - this is the proper method. However, if I select Caldwell, Matt and Gannon, Roan from the list while holding the 'Shift' key, the program deletes all the people from the program starting at Caldwell through Gannon (i.e., Caldwell, Carroll, Defoor, Diaz, Donepudi, Gannon) which should not occur. See attachments below that hopefully show the situation better.
    Attached Thumbnails Attached Thumbnails inactive people.jpg   all people.jpg  
    Daryl G

  2. Best Answer
    Posted by MacHeuS

    "I am not sure about this, but try this method;

    - Create new form like attachment
    - Popup this form with your query result added in left list
    - Then user select from left list and add record to right list with button or double clicking
    - After list completed get this list to recordset and delete form data

    I hope I could tell.

    Attachment 16463"


  3. #2
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    I'm afraid I can't help because this sounds like something half-baked by Brilliant Database.

    When you select more than one record from a list of items in a Query List, you can't right click and delete anything using CTRL or SHIFT. Displaying records other ways kind of works, but there doesn't seem to be any set way all this should work. Hence why it feels half-baked.

    Certainly something for the wish list to be improved on.

    Regards
    James

  4. #3
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    Last night, I came up with a concept of a solution to this issue which is reasonably simple. Since Brilliant Database supports Visual Basic, I should be able to just insert some VB script into the code to see if the 'Shift' key was pressed. I looked and saw that I should be examining for vbShiftMask =1. I inserted what I thought the script to be and, then, I was faced with the reality that I have never, ever been able to get Visual Basic Script to work in Brilliant Database. I then pulled MacHeuS's extremely brilliant solution (http://www.dbforums.com/showthread.p...-of-Data/page2) and and concluded (again) that our friend from Turkey is much smarter than I am!

    There should be a way in Brilliant Database to see if a particular key is pressed. If I can find that, I can fix this latest problem...
    Daryl G

  5. #4
    Join Date
    Jul 2012
    Posts
    94
    Provided Answers: 4
    I am not sure about this, but try this method;

    - Create new form like attachment
    - Popup this form with your query result added in left list
    - Then user select from left list and add record to right list with button or double clicking
    - After list completed get this list to recordset and delete form data

    I hope I could tell.

    Click image for larger version. 

Name:	sample-form.png 
Views:	13 
Size:	6.4 KB 
ID:	16463
    I do not know English well. I am using Google Translate for translation. Please do not laugh my sentences.

  6. #5
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    I ended up doing something quite similar to MacHeuS's solution. It took me a long time to actually figure out what was going on with this problem. Finally, I discovered that the behavior of the scripting was different when using 'Recordset=Input record(s) from a folder' AND selecting at least two people from the list when using 'Ctrl' versus 'Shift'. Since this portion of my project deleted records belonging to selected persons, I added a second line of scripting that checked the data a second time prior to deleting the records (this should NOT be required since the records were already checked PRIOR to appearing in the Recordset but that was the problem found). Conceptually, this added operation does the same as MacHeuS's recommendation.

    This quote is taken directly from the Brilliant Database User Guide: "To select several records, press and hold the Ctrl or Shift key and click all necessary records." However, from my first-hand experience, I can attest to the fact that the behavior of these two keys are not always the same. In most situations, 'Ctrl' and 'Shift' may work satisfactory and produce identical results... BUT this is not always the case! My recommendation is to thoroughly check the results using BOTH the 'Ctrl' and 'Shift' to ensure that the results are the same before moving on. This advice could save you many hours of frustration.
    Daryl G

  7. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    FWIW, Windows uses the CUA definition for events:

    Click alone selects a single object, which also defines an "anchor".
    Ctrl-Click adds the current object to the list of selected objects.
    Shift-Click works based on order, and it adds all items between the anchor and the current location.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  8. #7
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    Pat,
    I totally agree with what you stated. The issue with Brilliant Database that I ran into is that if a list created that had two names ('a' and 'z') that had a certain criteria from a list that had five names total ('a', b', 'c' 'd', and 'z') , things could go awry depending whether the two names appearing on the list were selected using the 'Shift' key or 'Ctrl' key. The 'Ctrl' key yielded proper results while the ''Shift' key performed operations to the records that did not meet the required conditions. The records represented here by 'b', 'c', and 'd' were never part of the data set yet these were receiving the same treatment as the actual two records that were.

    This could be an issue with semantics by me and it created a huge problem in trying to determine what the issue was and why the results were not in line with what should be happening. The 'For Each... Next' using Recordsets in Brilliant Database can produce invalid results (those Recordsets can be strange creatures!!!).
    Daryl G

  9. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I remember spending days debugging a shipping application that had that problem in the 1990s. The problem was that the app would present a grid of data, and to "remove" items from the grid it would set the row height to zero. This would produce exactly the symptoms that you're reporting because the whole grid was there, but some rows weren't tall enough to display.

    I'm not sure if Brilliant is having this problem or something completely different, but your description brings back waves of disgust about a problem that occurred to me nearly twenty years ago! While I don't use Brilliant, I understand your frustration... I've been there!

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •