Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 68
  1. #46
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    It's the Unbound combobox which is for the Patient name.
    This is part of the code that I tried in the "AfterUpdate"


    Code:
    Me.cmbPatient.SetFocus
    Me.cmbPatient = ""
    Me.cmbPatient.Requery
    THis did not work.

    Charles

  2. #47
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You have that code in the Provider combobox AfterUpdate? That should work. What happens?
    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. #48
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    The code is in the "Provider" AfterUpdate.
    What happens is nothing.
    However, when I click the dropdown for the combo "Patients" the listed names have a "Check Box" next to there name.
    Is that normal?
    The combo for the "Providers" do not have the checkbox.

    Charles

  4. #49
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    If the dropdown has check boxes then the combobox is bound to a field set up as multi-value. I NEVER use multi-value fields.

    Don't know what to tell you. SetFocus code works for me.

    Have you step debugged (refer to link at bottom of my post)? Does the procedure run? Have you selected [Event Procedure] in the Provider combobox AfterUpdate event?
    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.

  5. #50
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    I had the "Control Source" set to "Patient Name" when I remove it. All worked well.
    Now on to populating the associated fields for the "Selected" Patient.
    This would require populating the data with the "First" record for the selected Patient.
    And then being able to go to the next record for the selected Patient.
    Any suggestion on how ti do this will be fine my me.

    Thanks June7

    Charles

  6. #51
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Don't understand. If you have a form display all records related to selected patient, edit whichever one you want.
    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.

  7. #52
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    Currently I have the selection of the "Provider" populate the fields associated for the provider.
    When I select the "Patient Name" I want the fields for the patient to be populated from the Record info for that patient.
    This will be the "First" record for the selected patient. And if the data for the selected patient does not need updating I'll click the "Next" button to take me to the next record for the selected patient.
    But one step at a time. I'm wanting to retrieve the first recored for the selected patient.

    Charles

  8. #53
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    And what would be the 'first' record? The oldest or the latest?
    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.

  9. #54
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    It will be oldest.
    And as mentioned my next step will be have a "Next" button to go to the next record for the selected patient.
    I'll be stepping from the Oldest to the Newest.

    Charles

  10. #55
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Could set order as ASCEN date order then the oldest will list first.

    Are the records displayed in subform in Datasheet view?
    Last edited by June7; 09-03-2013 at 06:49 PM.
    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.

  11. #56
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    I attached what I have so far. It does not have a "SubForm"
    When you select the provider 14 it should populate the Green fields.(Note this is just for examples and will not be used later)
    Now when you look at the "Patient" combo you will see a list of "Patients" when you select a Patient I want the very first record for that Patient in the table for PatientsRecord
    to fill in the Form fields in Red.
    Once the data is loaded I will then have the "Next" button to go to the next record for the selected Patient. And, too the command buttons should also give you the hint as to what I want to do.

    If you look at my earlier post you will see what I trying to accomplish.

    Thanks
    Charles
    Attached Files Attached Files

  12. #57
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    The form is essentially the same as in the beginning of this thread and I must repeat it is not practical for data entry into multiple tables. I have also stated the most efficient and conventional approach is form/subform arrangement for data entry to associate patient with provider. You said in post 32 that you had form/subform - why is that not the case in this latest version you posted?

    None of the controls on the form are bound to fields. It will require extensive VBA code to populate with data from table and to save data edits, if unbound form is the approach you want to use.
    Last edited by June7; 09-04-2013 at 01:06 AM.
    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.

  13. #58
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    I now have the Form/Subform. But, now having an issue populating the Providers combobox in the form PRData.
    I was able to populate it in the previous attachment. What am I doing wrong?


    Charles
    Attached Files Attached Files

  14. #59
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Did you say earlier that a patient can have more than one provider? If that is true then the form/subform is not set up properly. Main form would be bound to Providers. Subform bound to tblPatientProvider (fields in tblPatientProvider should be for foreign key IDs). Combobox in subform to select patient. That's how to create records that associate patient with provider in many-to-many relationship.

    If a patient can have only one provider then tblPatientProvider is not even needed and this form/subform should work with a few changes. No patient combobox is needed. Just textboxes to enter/edit patient name. The Master/Child links of subform container will synchronize the related records.


    ProviderID is the primary key in Providers. This should be the foreign key in related table. The subform should link to main form on ProviderID.


    Confirm nature of data relationship. Can a patient have more than one provider?


    The provider combobox should not be bound to field because it should only be used to enter filter criteria. Use textbox to enter provider name for new provider record.
    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.

  15. #60
    charlesh is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Location
    Ms.
    Posts
    35
    Hi,

    The relation will be "Many to Many".
    As for the "Bound" and "Unbound". In my limited knowledge I think I tried it both ways for the provider.
    I set "Row Source" to "Provider" and Control to "Provider Name".
    It only showed 1 Provider. Not a List.

    Charles

Page 4 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 07-21-2013, 10:43 PM
  2. Replies: 12
    Last Post: 10-27-2012, 05:44 AM
  3. Replies: 5
    Last Post: 08-21-2012, 12:30 PM
  4. Use VBA to edit record or create new record in a query
    By ryantam626 in forum Programming
    Replies: 11
    Last Post: 08-09-2012, 02:37 AM
  5. Replies: 22
    Last Post: 06-12-2012, 10:02 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