Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Menu (A2K)

    Here's the situation. I have a Corporations file with a couple of hundred names. Each of these corporations also have related personnel. I would like to be able to specifically, from a dropdown, select any one of the corporations and printout only that corporation. The report as it stands now, would print out everything. I know I've seen this capability somewhere before, but as usual, can't find it when I need it. So, to recap, I want a form which accesses the Corporations Table, and I want to be able to select a specific corporation from a dropdown combo box and then click a preview button. Thanks in advance for any help.
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Report Menu (A2K)

    All you need to do is grab the key value from the combobox and then use it to set the WhereCondition argument of DoCmd.OpenReport. The WhereCondition argument is just like the WHERE clause of a SQL string but without the actual word "Where" in it. So if the condition is "Where [KeyValue]=123", then the WhereCondition string would be "[keyvalue]=123". And your OpenReport would look something like this:

    DoCmd.OpenReport "MyReport", acViewPreview, , "[keyvalue]=123"

    Does that answer your question?
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Menu (A2K)

    Charlotte, as always, you come through. Happy Canadian Thanksgiving.
    Andy
    Cheers,
    Andy

Posting Permissions

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