Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Posts
    48

    Unanswered: Need some advice on this design.

    I have patient database and I want to incorporate a prescription form. Basically, all it is, is a a form that will allow 8 prescriptions to be written out but to be saved incase a refill is need. The medications I have in a table stored.

    Let's say, Patient Joe Camel comes in... He needs to 3 prescriptions
    RX: Cancer sticks #5,000, SIG: 1 Q 1 Minute Till Death
    LabelFor: Lungs

    RX: Hair-U-Lose,Sig 1gallon,
    LabelFor:

    RX: Baclofen 10mg.; # ; sig 1/2tab b.i.d.x7d;LabelFor Brain Spasticity

    I know I can deisgn it:
    tblMainTable PID(1) - tblDetails PID, MedID(M)
    tblDetails PID, MedID(M) - tblMeds MedID(M)


    I know I can then plug this into a subform and it will store my results. What my question, is it possible to have it Meds seperate from one another? On the form, I want to have tabs that says Med1, Med2, etc. and have meds sperate from one another.

  2. #2
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    Hi Ron,

    A 'patient database'? What's it waiting for?

    Seriously, let me summarise my understanding of your requirement. You have a database with a parent-child relationship between Patients and Prescriptions. Each Patient may have zero to eight Prescriptions. You want to display a form containing Patient details that contains a sub form displaying Prescription details if any. The preferred format for the sub form is a tab control where each Prescription is shown separately, one to a page.

    Is this possible? The answer is, yes I think so; but you doubtlessly want to know how. Well you are into the realm of formatting the tab control each and every time you display it.

    First you need to count how many prescriptions there are for this patient and restrict the number of pages to the result. (Perhaps if this is less than eight you may want to include a page for entering a new, additional prescription. Personally however I would use a separate dialog form for this.) Then you need to label each page. Finally you need to populate each page.

    I have in the back of my mind that you cannot duplicate control names even if they are on different pages of the tab control. (Anyone care to comment?) What I suggest is that you devise a standard layout and a consistent naming standard. For example Medicine01 is the medicine control on page 1, Medicine02 is that on page 2, and so on. Now populating the pages becomes a little easier.

    Fortunately the page object in a tab control has a visible property so you can simply hide unused pages.
    Last edited by Rod; 10-11-04 at 06:08.
    Rod

    fe_rod@hotmail.com

  3. #3
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    -- Duplicate post. Sorry --
    Last edited by Rod; 10-11-04 at 05:58.
    Rod

    fe_rod@hotmail.com

  4. #4
    Join Date
    Sep 2004
    Posts
    48
    Thank you for the quick reply Rod. However, what you are suggestioning seems little bit too advanced for me, since I am starting out in Access and vba. I will look more into it and see if I can figure it out but I don't want to dwell too much on this if it beyond my capability.

    thanks

  5. #5
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    Ron,

    Don't be apprehensive about getting into the 'nuts and bolts' of Access. After all VBA is the unifying language behind all Office (and some third party) applications; it is the Access GUI and Jet database that are non standard.

    My advice would be to forget Access Macros and learn to do any more advanced requirements in VBA; that is, avoid learning macros and then relearning VBA. When you do get into VBA use the ActiveX Data Objects (ADO) model to access the Jet database. This at least 'standardizes' access to the Jet database such that you can communicate with any other ODBC database using exactly the same syntax as you do for Jet. Again don't learn DAO and then have to relearn ADO.

    There has been some good advice from Bud and others about writing an Access Macro and then converting it to see what the equivalent VBA code looks like. Learning by example is a great way to start.

    A final comment for the future is that VBA and ADO provide reasonable Object OrientATed Programming (OOP) features. Not everything is there (e.g. class inheritance is missing although interface inheritance is possible). Neither would you need to always use objects; sometimes accessing a database via a procedure is the best way to go. However all the world is becomming object orientated; all Access entities are in fact object classes and the forms, controls, reports, etc. that you work with are instants of those classes.

    OK, lecture finished: I am prepared to help you out with your requirement as it has interested me. If you want we can explore how you can give me an declassified version of your mdb and then I can construct your tab control and the ways of manipulating it.
    Rod

    fe_rod@hotmail.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •