Results 1 to 6 of 6
  1. #1
    Join Date
    May 2012
    Posts
    64

    Unanswered: Need button on report to open other page in navigation with details

    I have a navigation form with a patient data entry section with tabbed pages within it for visits, procedures, history, etc... The second navigation tab is a report center with tabs for different forms that will show patients with a specific disease in a list form (these reports only show patient names). I want to add a button alongside each patient name to view details that will refresh the main form to the details page with the corresponding patient information loaded.

    I don't want it to open another form window but jump back to the first tab in the navigation form with that patient's information pulled up.

  2. #2
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    If I understand you correctly, if the patients are being populated into a listbox, I would:

    1) Setup an Event Procedure on the 'Double Click' event on the listbox.
    2) I would then write a bit of code to update the control within the other tab with that patients name, and requery any controls that rely on that information.
    3) I'd finally add a line, like:

    Code:
    Me.myTabControlName.SetFocus
    To switch to that tab.


    Once done, you'd identify the patient from the list, double click them in the listbox, and the form will then take you to the tab (in this example named 'myTabControlName'), and populate all the data for that patient.


    Is that what you meant/wanted to happen?
    Looking for the perfect beer...

  3. #3
    Join Date
    May 2012
    Posts
    64
    The patients aren't in a list box. I based my form off a report that lists the names of patients with a certain illness. It's a continuous form not a list box.

  4. #4
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    Be more specific with your terminology, as I can't see it, all I can base my mental image off is from your description.

    A report and a form aren't the same thing. Are the patients names appearing within a Form object, or within a Report object?

    If a report, I'm not sure how you're going to get a button on there.

    If on a form, I would question why you would have a potentially huge number of separate buttons, when you could just as easily populate a listbox with all the patients in question.


    Are you able to post a sample database to show what you mean exactly?
    Looking for the perfect beer...

  5. #5
    Join Date
    May 2012
    Posts
    64
    If I used a list box, how would I make the name clickable and then populate a subform with related information to the patient that was clicked in the list box?

  6. #6
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    You would manipulate it with VBA.

    Like I have done quickly in the attached file.


    For a subform, you would use a statement like:

    Code:
    Forms!YourSubFormName!YourSubFormControlName.Value = Me.YourListBoxName.Value
    Attached Files Attached Files
    Looking for the perfect beer...

Tags for this Thread

Posting Permissions

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