Page 4 of 4 FirstFirst ... 234
Results 46 to 57 of 57
  • Thread Tools
  1. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    Because you still have not deleted all the superfluous stuff, I don't know what report you are trying to open from what form.
    You say you want to open a report to a specific visit, but I can't see any reports that are about one visit at a time. You have reports that list visits, and reports that are about patients, with visits in a subform.

    The form called "run old visitsreport" might be the one. The first combo should just list SSN numbers, and just have one column. The second should have two columns VisitID and Visit Date, (as it has), but only for patients whose SSN matches the other combo. Then the where condition just uses the hidden VisitID , which is the value of the combo box anyway.

    Any report you open with a VisitID Where clause must include VisitID in its recordsource. Without that you get a parameter prompt.
    Regards
    John



  2. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    Another problem with what you tried is because VisitID is a number field, not a text field , you don't need the chr(34)s.

    strWhere = "[VisitID] = " & Me.[ComboSSNVD]
    Regards
    John



  3. rlbroerman
    #48
    Guest

    Re: list box in form (access 2007)

    JH,
    You are correct. The report is "run old visitsreport" . I included "run visit report" to show how it work with only SSN.
    I am confused. I tried what you suggested but can't get it to work.
    Can you help some more, please.
    Rick B

  4. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    Here is a demo.

    frmRunVisitReport has 2 combos. The first just displays SSNs. The second displays visits for the selected SSN. Visit Date is displayed, but the ID is hidden in the first column, so the ID is the value of the control. Whenever the SSN is updated, the second combo must be requeried, and cleared. This code is in its AfterUpdate event.

    The command button opens a new report : rptVisitDetails that shows all the information about a specific visit.
    The Pain field is added to that report as a combo box. This displays the multiple values as a comma separated list. I think that is what you want.

    I deleted other forms and reports to make the zip file small enough to post.
    Attached Files Attached Files
    Regards
    John



  5. rlbroerman
    #50
    Guest

    Re: list box in form (access 2007)

    JH,
    Works great. It is exactly what I was wanting Thanks a bunch.
    When I copied this into my whole database I must have done something else inadvertently. Now when I run the report "copyof visits" it prints out multiples of the same info. Can you help, please.
    Rick B
    Attached Files Attached Files

  6. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    Rick

    It is difficult for me to look at 2007 files so I have not looked at the attachment. I will if I have to.

    When you use multivalued fields, you can add the .Value attribute for that field to the query. When you do that you get a separate record in the query for each of the many values.
    Is that what is happening?
    Regards
    John



  7. rlbroerman
    #52
    Guest

    Re: list box in form (access 2007)

    JH,
    This looks like it might be the problem, but I can't figure out how to implement your suggested solution. I don't see where to add ".value".
    Can you help, please.
    Rick B

  8. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    I was not telling you to put in it! I was saying to taking it out if you had it.

    I will have a look your db in a little while. Access 2007 is easier to get to now, as I have swapped computers.
    Regards
    John



  9. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    You have lost me I'm afraid.

    As I said a few posts ago, when you post a db for someone to look you need to take the time and trouble to make sure that what you are posting makes sense to other people.

    <UL><LI>Take out what is not relevant to the question
    <LI>Put in what is relevant
    <LI>Make sure it works[/list]I posted you a working demo, which was about opening a report from a form. It needed a form , a report and a query. What you have posted does not have any of the things , so what do you want me to look at?

    If you include just the PainID field from visits in a query, you will see the multivalued field in the resuts. If you join on that field to tblPainLevel, two things will happen:

    1. <LI>Visits with no pain will drop out of the results
      <LI>Visits with more than one pain value will appear more than once.
    I think that is your problem, but I don't know what query you need to fix,
    Attached Images Attached Images
    Regards
    John



  10. rlbroerman
    #55
    Guest

    Re: list box in form (access 2007)

    JH,
    The attachment in my post 732,168 has what you ask for, I think. I don't understand why "Visits with more than one pain value will appear more than once".
    Why would multiple pains cause multiple visits to be on the same report?
    Thanks again
    Rick B

  11. Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 44 Times in 43 Posts

    Re: list box in form (access 2007)

    The report copyofVisits gets its data from qryVisitsDate. Your visits table has 16 records, and so does qryVisitsDate, so I don't see any problem there.
    All of the visits in copyofVisits have different dates, so I can't see what the problem is.

    The subreport uses qryvisits, which joins table visits to tblPainLevel. As I explained last time. This only finds the last visit, but if it has multiple values for pain, it will return a separate record for each pain value.

    Is your problem with the main report or the subreport?
    Regards
    John



  12. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: list box in form (access 2007)

    This thread has become very long, so I will lock it. The discussion has been continued in the thread starting at <post:=738,103>post 738,103</post:>.

Page 4 of 4 FirstFirst ... 234

Posting Permissions

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