User Profile

Collapse

Profile Sidebar

Collapse
ADils
ADils
Last Activity: Apr 24 '12, 06:34 AM
Joined: Apr 23 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • ADils
    replied to How to Create Compound Relationship from Code
    Hello NeoPa, thank you for the explanation. I will take care of that.

    I included only the first two fields because I included those fields in the question that I asked, but three works just as fine (just tested).

    Note to other users: Close and open the relationships window to see changes after code execution.
    Note 2:
    Code:
    Set relatingField = Nothing
    to be added for cleaning up.
    See more | Go to post

    Leave a comment:


  • ADils
    replied to How to Create Compound Relationship from Code
    Hello NeoPa,
    Thanks for the reply! It has taken me quite some time to figure out what exactly you meant.

    I used the code from CodeProject
    and modified this a bit:

    Code:
    Sub AddCompositeKey()
    
        Dim Db As DAO.Database
        Dim newRelation As DAO.Relation
        Dim relatingField As DAO.Field
            
        Set Db = CurrentDb()
        
        Set newRelation = Db.CreateRelation("REF1",
    ...
    See more | Go to post
    Last edited by NeoPa; Apr 23 '12, 10:59 PM. Reason: Removed illegal link to competing site.

    Leave a comment:


  • ADils
    started a topic How to Create Compound Relationship from Code

    How to Create Compound Relationship from Code

    I have a database which is defined in a MIL standard. This consists of 104 tables and has a key that consists every time of three fields at minimum. I do not want to have all relations in the database because of stability reasons. Secondly, the data is delivered in a single DAT file and has to be spread over the tables through an import. I want to load the data and then run code to check on duplicates and orphan records, so it will not be during...
    See more | Go to post
No activity results to display
Show More
Working...