Results 1 to 5 of 5
  1. #1
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Reports list disappear in combo box.

    Hey there,

    I have a combo box where row source is Msysobjects table for reports list.

    the code for Msysobjects table is here and it gives fine results.

    Code:
    SELECT MsysObjects.Name, Mid([Name],5) AS QueryName
    FROM MsysObjects
    WHERE (((Left([Name],4))="rpp_"))
    ORDER BY MsysObjects.Name;

    This code is applied "afterupdate" event on this combo box and when we select the report from list it display the data but once we close the report and again try to select the other report but the report list disappeared from combo box and need to close the form and then reopen.

    Code:
    Private Sub testreport_AfterUpdate()
    
    Me.testreport.RowSource = ""
    
    DoCmd.OpenReport Me.testreport, acViewPreview
    
    End Sub



    What could be the mistake?

    thanks

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    If the name of your Combo Box is 'testreport' - then it looks like you are deleting the Row Source for the Combo Box with this line of code:
    Code:
     
    Me.testreport.RowSource = ""
    . . . which is saying, basically, 'make this Combo Box have no source from whch to get data'.

    Is there a reason that you have that line of code in there?

    Perhaps I am mis-understanding?

  3. #3
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Mr. Robeen, thanks for ur reply. there is no reason for that just copy from some where and use it.

    yes u are right = " " will delete the data.

    please advise what should i Use?

    thanks

    zee

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Try putting a single quote in front of that line to comment it out - and see if that fixes your problem - like this:
    'Me.testreport.RowSource = ""

    Let me know if that works.

  5. #5
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Sorry sir, it did not work. same results.

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

Similar Threads

  1. Reports in a list.
    By cap.zadi in forum Reports
    Replies: 11
    Last Post: 09-21-2011, 10:09 AM
  2. Printing reports off a list box
    By kbandong1 in forum Reports
    Replies: 3
    Last Post: 03-05-2011, 09:51 PM
  3. Replies: 11
    Last Post: 10-06-2010, 12:19 AM
  4. list available reports on form
    By farls in forum Forms
    Replies: 3
    Last Post: 10-09-2009, 07:24 AM
  5. Replies: 2
    Last Post: 03-13-2009, 08:35 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