Results 1 to 4 of 4
  1. #1
    UTS is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Downunder
    Posts
    17

    Problem getting new data to an open form

    I have two tables "Patients" and "Doctors". A main form is used to update the patients records, and there is a section to show the associated doctor details (name, address etc). The patient table records only the Doc_ID, and there is a one to many relationship between the two tables.



    To choose a doctor, it is just a matter of selecting him/her from a drop-down list and move on. However, if the doctor is not listed, I have a button that calls a form to add the new doctor to the Doctor table. So far so good.

    Unfortunately, the new doctor is not available in the main form until I close and restart the main form. When entering hundreds of records per day, this causes some turbulence to the normally smooth flow.

    I would like to be able to add a new doctor and add him/her to the current patient record without having to close/restart the main form.

    I have been fiddling around with sub-forms but don't seem to be getting anywhere.

    Cheers,
    UTS

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You might consider using the Requery method.
    It ensures that the Form [or other control] has access to the most recent data.

    Here's a link to some documentation:
    http://msdn.microsoft.com/en-us/libr...ffice.10).aspx

    Hope this helps!!

  3. #3
    UTS is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Downunder
    Posts
    17
    That sounds like the right path.

    The Doctor form updates the Doctor table directly, and the doctor details in the main form are from a query [Doctors List]. So, do I put [Doctors List].Requery into the "AfterUpdate" property of the Doctor form?

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I'm not sure whether you would requery the Doctor List 'control' [where your Doctor List is actually displayed] or the Main Form.

    Try issuing a Requery on the [drop-down combo box?] control of your Main Form - or the Main Form itself . . .
    in the After Update event or the On Close event of the Doctor Form.
    I'm not sure which one is better but I would choose the On Close just because it is the last thing [I think] before the Main Form is active again.

    All the best!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. OPen Form to add data
    By joemills62 in forum Forms
    Replies: 3
    Last Post: 06-17-2011, 10:14 AM
  2. Replies: 5
    Last Post: 03-03-2011, 03:56 PM
  3. Problem transfering data from form to table
    By softspoken in forum Access
    Replies: 2
    Last Post: 05-12-2010, 11:17 AM
  4. Form Data problem
    By rjjhome in forum Forms
    Replies: 7
    Last Post: 05-29-2009, 11:51 AM
  5. Form Data Entry Problem?
    By corystemp in forum Database Design
    Replies: 1
    Last Post: 03-21-2009, 02:29 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