Results 1 to 2 of 2

Thread: Container

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Exclamation Unanswered: Container

    I'd like to populate the Reports name in a list box using the next code:
    PHP Code:
      Dim cnt As Containerdoc as DocumentAs Integr
           Set cnt 
    CurrentDB.Containers!Reports
           
    For Each doc In cnt.Documents
           yourListBox
    .AddItem doc.Name
            i
    =i+1
         Next 
    But I get an error message in the For Each Statement that the cnt is not set or invalid.

    Any Idea?
    Thanks
    Last edited by hammbakka; 11-17-04 at 08:43.

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Ok, I could manage

    When I dont use CurrentDB and use an Object variable it functions
    i.e Dim db as DataBase
    Set db= CurrentDB
    Set cnt = db.Containers!Reports
    then it functions

    Why? Dont know

Posting Permissions

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