Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    rlbroerman
    Guest

    dual combo boxes (2007)

    I am trying to get info by either entering a SSN or name. I think I am close but can't seem to get it to work. Can you help, please.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    The code module for frmFindVisit contains two event procedures named cboSocSecNo_AfterUpdate. Duplicate names are not allowed.

    The event procedure cmdfindvisit_Click refers to a non-existent control ComboSocSec - it should probably be cboSocSecNo.

    In the event procedures cbolname_AfterUpdate and cboSocSecNo_AfterUpdate you refer to Me.Recordset.Clone, but the form is unbound so it doesn't have a recordset. You should refer to the recordset of the subform, and accordingly set the bookmark of the subform, not the main form. But it won't work since the record source of the subform refers to cboSocSecNo.

    I think you should simplify this - do away with the form and subform, create a form bound to the visits table and use the Combo Box Wizard to create search combo boxes.

    In the code module for frm Visit 2 A 3-20-07, you have commented out the line

    Private Sub Form_Current

    but left the rest of the event procedure uncommented. That invalidates the code.

  3. #3
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    Thanks for your response. While looking at old posts I found one you had sent post # 672317 that will allow me to pull up the most recent visit and let me save a duplicate of it with the current date and save it with modifucations. I think that addresses one of my major concerns; therefore I am going to pursue it. Attached is what I have done but it will not bring up the most recently added SSN and visit and save a duplicate of it. It will let me go back to other SSN and let me update them. I can't figure out what the problem is. Can you help, please.
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    I don't see anything in the database that you attached that will retrieve the most recent visit. <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  5. #5
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    Open the form "frmPatients" and then Find Patient 111-11-1111. In the subform
    it will bring up Visit 2/17/2008 which is the most recent visit. If I try to
    Find Patient 000-00-0000 it doesn't bring up a visit at all. That is my
    problem. Am I missing something?
    Thanks again.
    Rick B

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    This is because the record source of sbfVisits is the query qryVisits. This is a Top 1 query that returns the most recent visit overall, not the most recent visit by patient (SSN)
    In the attached version I have changed qryVisits so that it returns the most recent visit by patient.
    Attached Files Attached Files

  7. #7
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    Thanks for the solution but it doesn't seem to work. If I put into Find Patient the SSN 999-99-9999 it doesn't return the last visit it returns the second to the last visit. What am I doing wrong.
    Thanks again.
    Rick B

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    Open qryVisits in design view.
    Change the criteria for the date field to

    In (SELECT TOP 1 t.[Date] FROM Visits As t WHERE t.[Soc Sec No]=Visits.[Soc Sec No] ORDER BY t.[Date] DESC)

    Save the query.

  9. #9
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    Thanks, seems to work great. You are a wizard!
    See you next time.
    Rick B

  10. #10
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    I have aded to what you gave me last time but I have come up with a new problem. Here goes.
    The "sbfVisits" don't quite show all fields.
    The "frmPatients" shows only a small part of "sfbVisits" . I want to show all that is in the subform.
    Got any ideas. Please, help.
    Rick Broerman
    Attached Files Attached Files

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    1) Open sbfVisits in design view.
    Set its Scrollbars property to None.
    Reduce the height of the detail section until it extends just a little bit below the Physical Assessment text box.
    Reduce the height of the form footer to 0 - it is not used.
    Save and close sbfVisits.

    2) Open frmPatients in design view.
    Click once on the subform to select it.
    Move the mouse pointer over the lower right corner of the subform - it should change to a NW-SE arrow.
    Double click to resize the subform to the best fit.
    Reduce the height of the form footer to 0 - it is not used.
    Save and close frmPatients.
    You should now see the entire subform.

    Note: medcations should probably be medications.

  12. #12
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    I got your reply and tried it. Scrollbars doesn't hav a None option but it does have a "neither" option. I tried pulling the detail with arrow bar down but it doesn't seem to work. What am I doing wrong?
    Rick B

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    None, neither - same idea (I'm using a Dutch language version of Access at the moment, so my translation back into English is not always accurate).

    To decrease the height of the detail section, move the mouse pointer down to the upper edge of the gray bar delimiting the form footer, until the mouse pointer changes to a horizontal line with arrows pointing up and down. Then drag the mouse pointer upwards.
    Alternatively, click in an empty part of the detail section or click on the gray bar at the top of the detail section, then specify the Height property in the Format tab of the Properties window. Access will automatically adjust the height you specify if it is too small to accomodate the controls in the detail section.

  14. #14
    rlbroerman
    Guest

    Re: dual combo boxes (2007)

    Hans,
    Thanks for the help. The form is just what I want but when I open "Patient Visit" from switchboard and I press "New Visit" I don't get the current date with the last visits info like before. I get an error saying I am trying to save a record with a duplicat date. Can you help again, please.
    Rick B
    Attached Files Attached Files

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dual combo boxes (2007)

    I think it has to do with the way you have set up the subform, with only one record. You want it to display only one record and yet you want to add records. That causes contradictions.

Page 1 of 3 123 LastLast

Posting Permissions

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