Results 1 to 12 of 12
  1. #1
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Reports in a list.

    Helllo there,



    I have now many reports in my data base for each section or unit. so i am planning to have some kind of comobox or list which can contain my names of reports. so when we go to the form of that section and report should open by clicking on the text (Report Name).

    How is it possible?

    thanks

    zee

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    make a list box with this as it's control source

    Code:
    SELECT [Name] FROM MsysObjects
        WHERE (([Type] = -32764) AND ([Name] Not Like "~*") AND ([Name] Not Like "MSys*"))
        ORDER BY [Name];

  3. #3
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Hi rpeare,
    Your SQL works in a query but in the List Box it says "This control has an invalid control source."
    Any idea why that is?
    I'm using Access 2010.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I don't have access to your version so I couldn't say

  5. #5
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I plugged the SQL into Row Source and I get all my Reports in my Combo Box now.

    I'm also getting "#Name?" as the first Value in the Combo Box when the Form Opens.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    The original poster is not using your version of Access, nor has he posted back that it didn't work for him. Please don't hijack his thread. If it works in a query, it will work in a list box.

  7. #7
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hello Man,

    Thanks to be here always. Yeah let me try for this bcz i have the original sample db of that type but i did not try becz was worried how to get the things in query. let me try and i am sure it will work. will revert u soon. thanks

  8. #8
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hello Man, please can you explain little bit more how to do with this VBcode? thanks

    zee

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    It's not VB code, it's a SQL statement. IF you cut and paste the SQL statement into a query SQL window then run the query it will show you a list of all the reports in your database. Once you know that works then you can use the exact same query as a control source for your list box.

  10. #10
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    hello there, its working. thanks a lot. bye

  11. #11
    cap.zadi is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hello there, sorry have got the problem with reports.

    The Error is Runtime Error 2103

    The Report Name"abc" you entered in either property sheet or the marco is misspelled or reffers to a report which does not exist.

    please advise?

    thanks

    zee

  12. #12
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You'll have to be more specific about what you are doing or what code you are running.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-16-2011, 09:30 PM
  2. Printing reports off a list box
    By kbandong1 in forum Reports
    Replies: 3
    Last Post: 03-05-2011, 09:51 PM
  3. Reports w/ sub-reports very slow to open
    By vaikz in forum Reports
    Replies: 2
    Last Post: 02-27-2011, 08:41 AM
  4. Access Reports drop sub-reports
    By Kevin Ellis in forum Reports
    Replies: 0
    Last Post: 11-19-2010, 03:28 PM
  5. list available reports on form
    By farls in forum Forms
    Replies: 3
    Last Post: 10-09-2009, 07:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums