Results 1 to 4 of 4
  1. #1
    DannyBoy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    4

    Select from one of two fields to utilise in a one to many relationship

    Hi folks,



    So, I am slowly getting my DB in order (I think!), but now I’m migrating data I realised I have another issue.

    As things stand, I have my relationships defined as per the attached diagram, which if all of my issued documents matched I would have no issue with. We do however have to issue client documents which do not (and will not) have our references against them.
    I thought of adding a separate field which would populate with an IF THEN type statement, but I’m not sure a) how to do it(!) and b) if this is the best way to deal with it.

    See attached image for an overview of the current table values and relationships

    Click image for larger version. 

Name:	relationship.JPG 
Views:	9 
Size:	65.4 KB 
ID:	13361

    Any advice please?

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    No, that is not a good idea.

    Why do you have ID fields set as primary key if you are not saving as foreign key? Linking should be on Primary/Foreign key fields. Primary and Foreign key fields must be same type (autonumber/number, text/text).

    Use the ID field from tblDocuments as the foreign key saved in tblJoinXmtDoc.
    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.

  3. #3
    DannyBoy is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    4
    Hi June,

    Thanks for your reply (again!).

    I’ll have to take a step back from the DB to explain the process. My group are in a position where we either generate our own documents (some are transmitted and some are not), or transmit documents on behalf of our client. Some of our documents are issued to the client, at which point they have both numbers.
    Preference would always be to issue documents on a transmittal using our own number and only in instances where that isn’t available would we utilise the client document ID.
    Prior to set up of this DB, we tracked the numbers in a single column in Excel, which resulted in having to filter and manually manipulate the data when reporting was required – something which we would rather avoid having to do again, hence having distinct fields.

    To be able to issue a document, the user has to populate the document details (if not already available in the system), then create a transmittal by using a form. I have the form created with the relevant fields from the transmittal table, what I am struggling with is how we can manage the numbering issue and then how to add the document population details to the transmittal form.

    Does this all make sense? Or am I as clear as mud?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Doesn't change my previous comments.
    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.

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

Similar Threads

  1. relationship between fields
    By mandiahk in forum Access
    Replies: 9
    Last Post: 04-09-2013, 01:43 PM
  2. Replies: 24
    Last Post: 02-20-2013, 12:49 PM
  3. Replies: 6
    Last Post: 03-09-2012, 01:07 PM
  4. Replies: 0
    Last Post: 03-06-2012, 11:55 PM
  5. Replies: 5
    Last Post: 05-18-2011, 08:57 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