Results 1 to 7 of 7

Thread: Referencing forms from modules

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    52

    Referencing forms from modules

    I am trying to reference a listview, label and status bar from a module but cannot seem to get it to work. I have declared the form by saying dim frm as form1. This then errors everytime I reference my form. If I declare the form as a new form: dim frm as new form1, when I then say frm.show, it loops and loops around doing nothing. Any ideas?

  2. #2
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142
    Well, first of all, could you be more specific as to what you are trying to do? What exactly do you mean by referencing the listbox?

    To stop the looping, use frm.showdialog() instead of .show()
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    52
    Sorry, I should have been more specific. It is acutally a listview. I am adding items into the listview from a module and then trying to show the form. I have tried your suggesting but that does not seem to work.

  4. #4
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142
    Ah. Listview...hmm. I don't know anything about listboxes. Shooting blindly here, but could you not do much of what you are trying to do in the load() event for the new form instead of from the module?

    Another shot in the dark: Could you populate an array in the module, load the array data into a variable, then pass that variable into the new form?

    I would guess that the looping problem is unrelated to the listview thing, but again, just a guess.
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    mbjunior99 try posting your code and it will be easier to help you.

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2001
    Posts
    52
    Thanks for your help. I have put everything under the form and it is now working a treat.

  7. #7
    Addicted Member The Phoenix's Avatar
    Join Date
    Aug 2003
    Location
    With my wife
    Posts
    142
    Excellent! I'm glad to be of assistance. It makes up for all the times someone has had to help me.
    Take my love
    Take my land
    Take me where I cannot stand
    I don't care, I'm still free
    You can't take the sky from me...

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