Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    selecting additional records

    I have a "health and safety" part to my database. On this a user can select the type of works they are doing in a LIST BOX and it will populate a report with the appropriate control measures for the risks.

    There will be some overlap with the control measures so I'm thinking how to avoid this.

    E.G. user will be working with ladders and mobile platforms. Both of these will need working at height control measures and I don't want to repeat information.



    So I would like to have some things not visible in the listbox (working at height) but I want I want it to be selected when a relevant task is selected. That way I can have specific details for ladders/platforms then the general working at heights also.

    I guess I would implement the code to select associated tasks on the click event which generates the report? or the double click event in the listbox? (which selects it).

    What would this code look like? I don't need the code just cant visualise how to achieve this.

    Thanks, Andy.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Andy,

    It might help readers if you could provide some sample data showing how/where these overlaps might occur.
    It sounds like there are some specific items and also some "compound item(s)" that translate into 2 or more detail items.
    Sort of a partial hierarchy or things identified at slightly different levels.
    Not much of an answer, but hopefully will help the thought process.
    Good luck.

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    There's no hierarchy to this, that's the issue. Its all in one table of "risks and control measures".

    I have the selected data imported into word using bookmarks so I'm keen to keep the access structure as it is. ( there's a lot of code involved moving the data to word and this is working fine now. )

    The example in my post should cover sample data. But ill try to explain that example better:

    In this example we have three "risks".

    1. use of ladders
    2. use of working platform
    3. working at height.

    In this example 3 will apply whenever 1 or 2 is selected. So, there's no reason 3 should be visible at all as long as its selected (checkbox = true) when either of the other two are.

    I'll be able to exclude it from the listbox I'm sure. Currently the risks are selected via double click which just makes the checkbox = true.

    I guess the VBA would just be a series of If statements on the double click event? so If "ladders" is selected then heights = true?

    seems the only logical way to me but this could end up being a lot of code when there's data for hundreds of potential risks.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,891
    Think I had a similar situation with selecting laboratory tests for sample. Tests can be selected individually but then some of them are part of a 'compound' test. So selecting the 'compound' test number should automatically include a defined set of tests. I created a table that defined these 'compound' test relationships. I have a listbox on form that lists the associated tests when a compound test is selected. And a label that instructs users to not select the associated tests individually, even though they are still in the combobox list. Then code prevents selecting the individual tests that are included in the 'compound' test group, just in case user tries to anyway. And if they actually selected the associated test first then the compound test, code will 'fix' the selections.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Ill think about it, Thanks for the reply.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-15-2018, 11:45 AM
  2. Updating Activity Records with additional data
    By acalkins1957 in forum Queries
    Replies: 1
    Last Post: 07-29-2014, 11:40 AM
  3. Unable to add additional records
    By MushingJeep in forum Programming
    Replies: 1
    Last Post: 01-15-2014, 10:46 AM
  4. Append additional records
    By BFlat in forum Queries
    Replies: 2
    Last Post: 04-20-2012, 02:28 PM
  5. additional detail records to be inserted
    By Mclaren in forum Reports
    Replies: 1
    Last Post: 03-16-2011, 02:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums