Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    angybab is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2020
    Posts
    35

    Repeat a function as many times as possible

    Hi all,
    its me again. I have a combo box that is used to select items the type of tumor.
    But a patient might have many types of tumor.


    I need a button which will allow one to add more tumors (meaning repeating the previous event)
    how can I do that?

    thanks in advance

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not knowing your table structures, you would/could have a (junction) table to hold the tumors. I would have a subform to select the tumors/illnesses.

    Edit:
    Would you post your dB?

  3. #3
    angybab is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2020
    Posts
    35
    Hi,
    thanks for your quick reply. I already have the list to select from in a combo box. I only want the same action to repeat it self
    as many times as necessary

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I find your post a bit confusing. The title refers to a function. You want a button to be able to select more than one item from this combo list because at present, you cannot (to be expected)? You aren't asking where to put the records based on multiple selections from a list - or are you??

    I suspect you should have a listbox from which you can select multiple types, not a combo.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I already have the list to select from in a combo box. I only want the same action to repeat it self
    use a subform. each new row, you select a tumor. Does sound like you do not have the correct table structure for what you are trying to do.

  6. #6
    angybab is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2020
    Posts
    35
    let me try to explain that better. I have a list in a combobox which selects the type of tumor a patient has, but since a patient mit have more than one type of tumor. I want to add a button unterneath the combox which will say "add more tumors" and when the button is clicked the same combobox above appears and the second, third, fourth ........ tumor can be entered. I think this should be very easy to accomplish but since am very new to access I need to search long for some features.

    lets say: cboxyz (selects first tumor type)
    buttonxyz (add more tumor)
    cboxyz (selects second tumor type)
    etc

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by angybab View Post
    let me try to explain that better. I have a list in a combobox which selects the type of tumor a patient has, but since a patient mit have more than one type of tumor. I want to add a button unterneath the combox which will say "add more tumors" and when the button is clicked the same combobox above appears and the second, third, fourth ........ tumor can be entered. I think this should be very easy to accomplish but since am very new to access I need to search long for some features.

    lets say: cboxyz (selects first tumor type)
    buttonxyz (add more tumor)
    cboxyz (selects second tumor type)
    etc
    How do you propose to show the selected tumors that have been selected for each patient and where do you propose to save this data.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    angybab is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2020
    Posts
    35
    Quote Originally Posted by Bob Fitz View Post
    How do you propose to show the selected tumors that have been selected for each patient and where do you propose to save this data.
    I wish to save the first selection in a field called tumor_typ1 and the second and so in tumor_typ2 ........

  9. #9
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Research the Not In List event for a combo box or

    open a small input form bound to your tumor list table and enter a new list item there. When that form closes, requery the combo box on the first form.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I wish to save the first selection in a field called tumor_typ1 and the second and so in tumor_typ2 ........

    what is your table and file structure, your description sounds like you are trying to use spreadsheet methods, not database methods

    I would expect you to have tables something like

    tblPatients
    patientPK
    patientName
    ...
    ...

    tblTumorTypes
    tumorPK
    tumoreName


    tblPatientTumors
    PatientTumorPK
    patientFK
    tumorFK

    your main form would be based on tblPatients
    it would have a subform based on tblPatientTumors which contains one combo control with a rowsource of tblTumorTypes

  11. #11
    angybab is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2020
    Posts
    35
    Hi Ajax,
    I have tblPatients and tblTumor:
    in tblTumor is PID and tmor_typ1, tumor_typ2 .........

  12. #12
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Here's one example of how you might do it using a "junction" table:
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  13. #13
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    and another way
    Attached Files Attached Files

  14. #14
    angybab is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Oct 2020
    Posts
    35
    thanks Bob, thanks Ajax,
    I wanted something like the form below. Like when you are filling an application form and you need to press a button
    to add more job qualification or more school qualification. Just like the button "Add Subject". After entering the first subject. You can click the button "Add Subject"
    to add more subject. In my case add more tumortype

  15. #15
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I repeat, use a subform - but set the subform to single form rather than continuous, and set data entry to true

    since you want the user to do additional activity to click a button, just set a button on your mainform with the code

    mysubformname.requery

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-01-2016, 03:46 PM
  2. Replies: 2
    Last Post: 02-25-2015, 05:02 PM
  3. Replies: 3
    Last Post: 06-10-2014, 11:50 AM
  4. Replies: 2
    Last Post: 08-19-2013, 01:14 PM
  5. Replies: 30
    Last Post: 08-15-2012, 02:25 PM

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