• Use a subform to display multiple entries….

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Use a subform to display multiple entries….

    Author
    Topic
    #470678

    on one tab.

    Sorry about the split title, i just cant think of a more eloquent way of putting it.

    Im creating this database for the pulmonary rehab department of our hospital, and basically the scenario is this.

    Each patient should only be displayed in the system once for one referral, however, on one referral a single patient can have multiple Courses, and multiple Assesments (to see how things are progressing etc)

    the system is staying small and simple (best judging the clients using it…) so i have kept it all on one form, in tabs.

    so i have a tab for every aspect of the database (patient contact details, Referral Details, Assesment details, Course Details, Follow-up Details and Discharge Details)

    to display the multiple Assesments, i have created a query which will show me all assesments where patientID, Referral Date and Referral Source are the same. It works!

    it displays all the relevent data, and a blank bar at the bottom to add new data, which is what i want, as a new assesment will be entered into this form as well.

    However, because i will only be editing 3 boxes in this subform, i am missing the criteria for the query, when i add Assesment Date, Outcome etc it only adds those to the table. so there is no PatientID Referral Date or Source to be picked up by the query. Which actually makes perfect sense!

    I have tried a “save button” to set the text boxes to put their data through to the table, along with the query criteria. but no joy. it just errors, saying i have not defined an object.

    the code is not relaly the point, as there must be an easier way to do this job, i just dont know it, do any of you have any ideas?

    Viewing 3 reply threads
    Author
    Replies
    • #1236929

      Christopher,

      OK, a multi-field link is rarely a good idea, but putting that to one side…..

      On your subform, add three controls, one for each missing data element. Bind these controls to the underlying data. Set the default value for each to the relevant data from the main form.

      When you add a new record, the defaults should be picked up and saved. The controls do not need to be visible, I would tend to make them visible while debugging.

      Hope this helps,

      Jules

    • #1237169

      that worked brilliantly.

      I had started work on somethign similar after the post, but i was actually stuck on how to get the correct data into those fields (duh..)

      Can i ask why its not a good idea?

    • #1237193

      A couple of things – on your thread title you can continue it into the description if you need more characters – I’ve done that for you.

      On the issue of multiple links, I think the general concern is that the more links you have, the more fragile relationships become, and the more likely data may be corrupted. However in your case, it seems to make good sense to take that approach given your data structure. The other aspect of it is that it often means that there is an issue with the database table design that is causing you to need multiple links – that may or may not be the case with your situation.

    • #1237288

      there probably is an issue with the database table design. it is a little messy. i have a table for the Data, and a table for OUtcomes and Locations (as each tab shows a different list of potential locatiosn etc)

      However, i dont have a tble for Assesment details and Course Start details, and was trying to keep all the data together.

      One thign i have done is insert a “RecordStubFlag” field which is a true false, and using the default value method listed above, anytime you fill a record in those tabs, it flags it as a Stub, and therefore can be filtered out from general use.

      Wendell, thank you for explaining that to me, im not sure if i understand it however.

      surely the more links there are (within reason) the more verified the data will be thusly making it more reliable. i was thinking this is similar to a multi-part Key. or do they suffer from the same issues?

      Sorry if this has strayed away from the main topic. obviously this is just me learning.

      Thanks again!

    Viewing 3 reply threads
    Reply To: Use a subform to display multiple entries….

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: