Results 1 to 7 of 7
  1. #1
    Brownie1987 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    UK
    Posts
    7

    Creating calculated fields from different tables

    I'm relatively new to using Access. I have built a basic patient database for my hospital's surgical service but am struggling with a few things.
    This time, I am struggling to link operations into a specific admission.



    What I am trying to achieve is for all of the operation records relating to an admission record (held in separate one-many (admission-operation) linked tables) to be able to show as a single, calculated field in final report.

    Is anyone able to explain how to do this, please?

    Thanks

    Oli

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    you would put it in the query. Speed: [Dist]/[Time]

    then you can show it on forms or reports.

  3. #3
    Brownie1987 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    UK
    Posts
    7
    Thanks,

    I am able to write reports to query it but I'm wondering if it is possible to pull all of the records into a single calculated field.

    For example in my patient database I might have

    Table: Patients

    Donald Duck
    Mickey Mouse

    Table: Operations
    Donald Duck - Appendicectomy
    Donald Duck - Haemorrhoidectomy
    Mickey Mouse - Left leg amputation

    I want to know if I can create a calculated field which would give a record in the Patient table which looked more like

    Donald Duck - Appendicectomy, Haemorrhoidectomy
    Mickey Mouose - Left Leg Amputation

    It's vital that the operations are maintained as a separate table, because there's loads more information in other fields and to maintain their auditability.
    In actual fact, Patients have admissions and within admissions have operations! but am looking initially to work out how to create the calculated field in Admissions so that the final report can show multiple operations per admission in a single field (rather than creating multiple lines). Does anyone know how to do this?

    Thanks

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    databases dont really work that way....they show data vertically, with zero effort.

    Now a report can show items top-down then next column
    or
    left-to-right, then next row.
    (in report, page setup)

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,121
    Hi Brownie1987,

    Yes, you can do that fairly easy. There is a custom function on the web called JoinFromArray that would give you exactly what you want. I believe I got it from the Access MVP site, but you can also download it from my site (forestbyte.com) under the VBA code samples page.

    Cheers,
    Vlad

  6. #6
    Brownie1987 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    UK
    Posts
    7
    Thanks vlad!

    I've been reading about various modules you can write to concatenate tables!

    Will look at this one

    Best

    O

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    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. Replies: 1
    Last Post: 04-12-2017, 07:39 AM
  2. Replies: 1
    Last Post: 03-14-2016, 06:44 PM
  3. Replies: 12
    Last Post: 10-01-2013, 12:59 PM
  4. Calculated Fields in tables
    By dharsh in forum Misc
    Replies: 12
    Last Post: 07-01-2013, 03:07 PM
  5. Replies: 10
    Last Post: 11-05-2011, 11:41 AM

Tags for this Thread

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