Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Posts
    4

    Unanswered: Basic ms access db question

    I have this college asignment for next week in MS Access 97 and I am having a few problems working how to go about it.

    The task is to create a hospital database with a loans system for the patients. So far I have created the following 'tables':


    - patients
    which contains the following fields:
    - patient id
    - patient name
    - address
    - date of birth
    - sex

    - equipment
    which contains the following fields:
    - equipment id
    - equipment name
    - cost
    - number in stock

    - loan
    which contains the following fields:
    - loan id
    - patient id
    - date of loan

    - loanitems
    which contains the following fields:
    - loan id
    - equipment id

    I've set up the relationships, which I've attached as an image below.

    How can I make it so that a user selects the patient and then selects what equipment they would like to loan.

    I'm really stuck, searched everywhere.
    Attached Thumbnails Attached Thumbnails relationships.gif  

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Basic ms access db question

    The easiest way, without having to write any code is to use main and sub forms.

    Start by creating a form using the Form Wizard. Select the Loan table and add all the fields. Then select the loanitem table and select all the fields.

    As you click next, at some point the wizard will promtp you to select between subform or linked form. Select subform

    Complete the wizard. Two forms are added to your db. One is the main form (contains fields from the loan table) and the other is a sub form (contains the fields from the loansitem table).

    In the design of the main form, change the PatientID textbox to a combobox. In the propeties for this combobox set the rowsource = patients, for column count set it to 2 and for column widths type 0,3. This will give you a selection box that you can select a patient.

    In the subform, hide the loanID field. Change the equitmentID textbox to a combobox. In the propeties for this combobox set the rowsource = equiptment, for column count set it to 2 and for column widths type 0,3. This will give you a selection box that you can select an equiotment.

    The link between the load and loanitem is automatically created. You will not need to woorry about linking this.

    Hope this is a start for you.




    Originally posted by iamjoec
    I have this college asignment for next week in MS Access 97 and I am having a few problems working how to go about it.

    The task is to create a hospital database with a loans system for the patients. So far I have created the following 'tables':


    - patients
    which contains the following fields:
    - patient id
    - patient name
    - address
    - date of birth
    - sex

    - equipment
    which contains the following fields:
    - equipment id
    - equipment name
    - cost
    - number in stock

    - loan
    which contains the following fields:
    - loan id
    - patient id
    - date of loan

    - loanitems
    which contains the following fields:
    - loan id
    - equipment id

    I've set up the relationships, which I've attached as an image below.

    How can I make it so that a user selects the patient and then selects what equipment they would like to loan.

    I'm really stuck, searched everywhere.
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  3. #3
    Join Date
    Dec 2002
    Posts
    4

    Thanks

    Thankyou for reading and replying to my post.

    I will follow your instructions!

    Thanks

  4. #4
    Join Date
    Dec 2002
    Posts
    4

    Re: Thanks

    Originally posted by mona
    In the design of the main form, change the PatientID textbox to a combobox. In the propeties for this combobox set the rowsource = patients, for column count set it to 2 and for column widths type 0,3. This will give you a selection box that you can select a patient.

    In the subform, hide the loanID field. Change the equitmentID textbox to a combobox. In the propeties for this combobox set the rowsource = equiptment, for column count set it to 2 and for column widths type 0,3. This will give you a selection box that you can select an equiotment.

    The link between the load and loanitem is automatically created. You will not need to woorry about linking this.
    How do I change a textbox to a combobox.. do I just delete the textbox and insert a combobox that links to the 'patients' column?

    Also, there is no 'equipmentID' textbox, so how can I change it?

    This is what I have so far..
    Attached Thumbnails Attached Thumbnails image2.gif  

  5. #5
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Thanks

    In design view, select the textbox, from the Format menu, select Change To, then Combobox...

    Now the properties dialog box should display all the options for a combobox ...


    Originally posted by iamjoec
    How do I change a textbox to a combobox.. do I just delete the textbox and insert a combobox that links to the 'patients' column?

    Also, there is no 'equipmentID' textbox, so how can I change it?

    This is what I have so far..
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

Posting Permissions

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