Results 1 to 5 of 5

Thread: problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    27
    can anobody tell me whats wrong here...i get a compile error saying something like "only public defined blah blah blah"
    what i am trying to do is add the type to the collection.

    Private Type NameValue
    lsFValue As String
    lsRValue As String
    End Type
    Dim fcNameValue As NameValue
    Dim fcCol As Collection
    Dim num As Integer

    Private Sub Command1_Click()
    fcNameValue.lsFValue = "FVAlue"
    fcNameValue.lsRValue = "RValue"
    fcCol.Add fcNameValue, Str(num)
    num = num + 1
    End Sub

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    I had that exact problem just a month ago.

    Solution :

    Create a New Class with the class builder utility.
    Add the variables that you require to this class using the class builder.

    Still in class builder.

    Now create a new collection of the class.
    Update the project


    Quite easy when you know how.
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    27

    Talking thanks but wont "type " work?

    thanks for that solution....but i already knew that....i was wondering if i cant do it with the "type" fellow and not the "class" fellow...

    od

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    As far as i know, and i may be wrong, the answer is can you bollox.

    I tried everything under the sun to get the type to work, but to no avail.

    Maybe someone else knows though.
    Iain, thats with an i by the way!

  5. #5
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    If you're declaring using Dim, then user-defined types in Standard or Class modules will default to Public. If you intend a user-defined type to be private, make sure you declare it using the Private keyword.

Posting Permissions

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



Click Here to Expand Forum to Full Width