Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open report from a list box (Access 2000)

    My attempt to open the report from a list box has failed, according to my attachement,although i write the line correct.What is the reason? I

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Open report from a list box (Access 2000)

    For a start the following line has a compile:
    Me.sbfCalls.Visible = Flag

    Also you need to check a refernece to the Microsoft DAO 3.6 Object Library.

    Until you define sbfCalls above, I can't help you, i would be guessing.

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

    Re: Open report from a list box (Access 2000)

    There is no instruction to open the report in your code. You must insert the following line above End Sub:

    DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria

    However, it won't work in the database as posted by you, since the report is based on tables that are not present in the database.

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

    Re: Open report from a list box (Access 2000)

    By the way, I recommend using the On Dbl Click event of the list box, and/or provide a command button to open the report. I would *not* use the On Click event of the list box - that makes it impossible for the user to use the arrow keys in the list box, since each time a different item is selected, the report would be opened.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open report from a list box (Access 2000)

    Thank you very much indeed for all your advices.
    I have the following problem with my list box called ListOffers.The first item is ClientID and not offerid therefore my criteria for opening the report stLinkCriteria = "offerid = " & Me![list]));
    My question is, can i use this list box at all to open the report for the offers? because the offerid exsits in the row source but not on the first place

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

    Re: Open report from a list box (Access 2000)

    You don't need the ClientID column. Change the Row Source to

    SELECT TblOffers.offerid, TblOffers.offerdate FROM TblClients INNER JOIN TblOffers ON TblClients.ClientID=TblOffers.Clientid WHERE (((TblClients.ClientID)=Forms!frmClients!ClientID) );

    and set Column Count to 2 and Column Widths to 0,9cm;1,549cm. That way, OfferID will be the first column.

  7. #7
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Open report from a list box (Access 2000)

    Thank you very much with all myy heart, Hans ! it is superb now

Posting Permissions

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