Results 1 to 4 of 4
  1. #1
    John V is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    43

    Update multiple subforms without updating main form information

    I am not quite sure that my subject line actually describes what I am try to achieve, so I will do my best to describe it here.

    I am creating a database to track patient visits to various medical clinics. I have a Contact information form where I can enter (for a new patient) or update (for a returning patient-if required) the contact information for the individual. This form has a field to enter the Patient ID number. This is the PK for the Contact Information table and the FK for all of my other tables in this database.

    I then have a form for entering the details of the medical visit. This has a list box for choosing the Patient ID number for the patient. This form also has 13 subforms linked to the underlying tables for storing the visit information. Each subform has various quantities of checkboxes for making selections in various categories (one category for each subform/underlying table).

    I would like to have a "New" button that would clear the data in ALL of the subforms in but NOT the Listbox on the main form in preparation for entering information about the patient's visit.

    I would also like to have a "Next" and "Prev" button for moving through the records on ALL of the subforms related to the Patient ID selected in the Listbox on the main form. Basically a method for scrolling through all of the visit forms for the selected patient.

    It should be noted that the subforms are not popup forms they are designed to look as though they are all part of the main form.

    Am I asking to much of Access here or have I gone off in completely the wrong direction? Is there a way I can accomplish what I need with what I have done?

    Any help is appreciated.


    John V

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Are these subforms in Single view?

    The "New" button would be code that moves to a new record in subform. If you want one button on the main form to do this for all subforms, will require setting focus to each subform then moving to new record. Example:

    Me.sfSpecialBilling.SetFocus
    DoCmd.GoToRecord , , AcNewRec

    Not really clear to me what you mean by the "Next" and "Prev" buttons. You want only one pair of buttons on the main form?
    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.

  3. #3
    John V is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    43
    Quote Originally Posted by June7 View Post
    Are these subforms in Single view?

    The "New" button would be code that moves to a new record in subform. If you want one button on the main form to do this for all subforms, will require setting focus to each subform then moving to new record. Example:

    Me.sfSpecialBilling.SetFocus
    DoCmd.GoToRecord , , AcNewRec

    Not really clear to me what you mean by the "Next" and "Prev" buttons. You want only one pair of buttons on the main form?
    Thank you June7.

    Yes the Default View on each form (used as a subform on the main form) is set to Single Form. Is this a bad thing?

    As far as the "Next" and "Prev" buttons go, I found out from my wife (the one I am designing the database for) that this is something that I need to implement into reports. I will ask again about this later, so let's forget it for now.


    I will try this. Do I need to have a Setfocus statement for each subform and a Do.Cmd.GoToRecord , , AdNewRec statement for each subform?

    Thank you
    John V

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Single view for subforms is not bad, just don't see as often as Datasheet or Continuous.

    Yes, for each subform.
    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. Multiple subforms to one main form
    By mick3911 in forum Forms
    Replies: 8
    Last Post: 02-25-2013, 09:40 PM
  2. Replies: 4
    Last Post: 09-17-2012, 10:36 AM
  3. Form Stops Updating Subforms
    By caddcop in forum Forms
    Replies: 1
    Last Post: 04-06-2011, 08:37 AM
  4. Replies: 5
    Last Post: 02-08-2011, 11:17 AM
  5. Replies: 0
    Last Post: 12-16-2008, 07:49 AM

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