Results 1 to 15 of 15
  1. #1
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12

    Dlookup to search the Matching string and autopopulate

    Hello Everyone;
    I am new to this forum and need help to build a database. I apologize before hand if I am asking a wrong question. Lemme begin!
    I am creating a database for a maintenance program (failure mode and effect analysis) and I have a many to many relationship.
    I have 5 tables
    1)tabEquipments
    2)tabParts
    3)tabFailureTypes
    4)tabCauses
    3)tabMaster (to establish relationship for many to many)
    I have a from with two cascading comboboxes comEquipment and comParts.
    These filter data to two other combo boxes.
    Need of the hour
    One of the project requirement is to create a new Equipment add existing Parts to it and populate the respective part’s failures and causes by creating a new record.
    Confusing? Will debrief you guys-
    In the example I have added a new equipment “EquipmentX” and added existing part “Oil Seal” to it by creating a new record. Now I want to auto populate the Failures and Causes for the previously available “Oil Seal” by creating a new record. How do it do this?

    I think I need to use Dlook up to match the string “Oil Seal” and autopopulate its information. But I do not know how to do it.

    Kindly Help

    I have attached the DB.
    Attached Files Attached Files

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Welcome to the forum. First question - is this a school project? If so, I think our responses need to be kept simple so you can complete the exercise. If not, perhaps more in depth responses would be warranted. For a functional FMEA db, I would have some concerns with your current situation.
    I think to keep the answer to your specific question simpler for now, cascading combos would probably be the way to go. Choose a part from combo1, combo2 presents a list of applicable failures (or whatever is appropriate for the next step); combo3, the next child level, is filtered according to the value chosen in combo2, etc. You can only DLookup one field from one domain at a time.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12
    Hello,
    This is a college project. I have made use of cascading combobox in the sample database attached. I just want to copy the child records if the same parent is added but this time as a new record. Basically I want to copy Failures and Causes to the new record "oil seal".

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    You have a way of relating parts 1 and 10 to equipment 1 or 3, but no way of relating a failure or a cause to any part, whichever it is you'd want to do. So it's not really possible to auto populate anything as you're trying to do, because you have no basis on which you can make a decision. The simplest answer I can give is that one might use DLookup to lookup the value, but I have no idea where you'd pull it from. While you have "not working" and "motor dirty" for one record, that record's part ID is 1. For the next seal record, you appear to have a different parts id, so nothing is common. Perhaps it is more precise to say that oil seal is 1 in one record and 10 in another, thus you have no common/relate-able factor.

    Unfortunately, if this is an FMEA db, then I think you're off on the wrong foot with the table design. I'm thinking more along the lines of tables for
    - equipment
    - parts
    - failures
    - effects (or causes, as the case may be)
    and junction tables for
    - equipment/parts (to associate parts to equipment)
    - failures/parts (types?) to associate failure types to part types
    - failures/causes? (this one I'm unsure of as I'm not really sure of what it is you're creating the db for).

    Even if it's not an FMEA db, your design won't support your request. Suggest you research FMEA type database designs.

  5. #5
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12
    You are right in saying that "oil seal" with ID 1 and "oil seal" with ID 10 are two different records. "Oil seal" with ID 1 and "oil seal" with ID 10 even though have different ID's they have a matching string.Can't I have a Dlookup to match the string ?
    The common relatable factor is the same string "oil seal".

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If the search criteria is 'oil seal', which ID should be returned?
    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.

  7. #7
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12
    The new ID i.e. ID 10. Since it is linked with "Equipment X" with ID 3.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Then you need more parameters in the DLookup.
    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.

  9. #9
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12
    What kind of parameters are you talking about?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Haven't examined your db. So can only guess maybe also the equipment ID?
    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.

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Maybe I can weigh tomorrow since i have seen the db. Been a busy weekend. I'm on my phone right now and it's late here.

  12. #12
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12
    This is a crucial part of my project. A little help with this problem will help me go a long way.

  13. #13
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12

  14. #14
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Ok, so I took a second look. The answer is no, you cannot. I'll repeat why:

    - you have no linkage (relationship) between either causes or failures AND parts
    - you have no relationship between either causes or failures AND equipment
    - even if you did have a relationship between parts OR equipment you have no way to link back through one to another. In other words, no way to get from C to A by going through B.
    For the benefit of those who can't download your db because of version issues (or whatever) I've posted your tables for any additional comments that others might want to provide - or even dispute what I'm saying.
    CausesID Causes
    1 Motor dirty
    2 Cable damaged
    5 Contamination
    6 Seal worn out

    FailureID Failures
    1 Not working
    2 Not filtering
    5 Slow rotation
    6 No control

    EquipmentID Equipment
    1 Pump
    2 Compressor
    3 Equipment X

    PartsID Parts EquipmentID
    1 Oil Seal 1
    2 Diaphragm 1
    5 Limit switch 2
    6 Blades 2
    10 Oil Seal 3
    MasterID PartsID FailureID CauseID
    1 1 Not working Motor dirty
    2 2 Not filtering Cable damaged
    5 5 Slow rotation Contamination
    6 6 No control Seal worn out


    Would be much appreciated if you post back with how your db is received if you stay on this path.
    Good luck!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    Axel is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    12
    Thank you Micron for you valuable suggestion.
    If i cannot autopopulate the Failures and Causes of the old "oil seal" to the new"oil seal" then the only thing I can do is to manually drop down and select.

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

Similar Threads

  1. dlookup columns matching
    By petertje in forum Programming
    Replies: 1
    Last Post: 01-04-2014, 04:14 PM
  2. Matching or Dlookup?
    By 201034 in forum Queries
    Replies: 3
    Last Post: 07-18-2012, 06:06 AM
  3. matching part of the string from two columns
    By hoachen in forum Queries
    Replies: 4
    Last Post: 12-20-2011, 01:54 PM
  4. Replies: 4
    Last Post: 12-02-2011, 11:20 AM
  5. String Matching
    By tuna in forum Programming
    Replies: 1
    Last Post: 05-16-2010, 12:22 PM

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