Results 1 to 5 of 5

Thread: [RESOLVED] frmOptions

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    10

    Resolved [RESOLVED] frmOptions

    I'm new to VB 6... i'm a .net developer by day.

    I'm doing a project for school using VB 6.

    I want to have an Options menu, so through the menu editor I added Tools > Options and frmOptions was created.

    My problem is, i can't figure out how to pass in the variables on my frmMain to the frmOptions... I haven't even tries sending the changed values back.

    I first tried creating properties on frmMain for my variables and then when in the frmOptions I would just set the local variables to the frmMain.MyProperty. This gave me a object or with clause not set

    So then i set properties on the frmOptions and when i opened the form from frmMain, i set those properties
    ie>
    with frmOptions
    .MyProp = strString
    .Show vbModal, Me
    end with

    This gives me the same error... is there some instantiation not ebing done? I think i've tried almost every combination.

    Any help would be greatly appreciated. My project is due on Turesday and I really dont want to be screwed by something dumb like this. Or have an incredibly ugly interface

    Thanks in advance <3

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,235

    Re: frmOptions

    You need to open the Menu Editor in frmMain then add an Options menu.

    Caption - Options
    Name - mnuOptions
    VB Code:
    1. Private Sub mnuOptions_Click()
    2.  
    3. frmOptions.Show vbModal, Me
    4.  
    5. End Sub
    You don't need to use the Tools/Options.
    Keith

    I've been programming with VB for 20 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  3. #3
    Frenzied Member Andrew G's Avatar
    Join Date
    Nov 2005
    Location
    Sydney
    Posts
    1,587

    Re: frmOptions

    Try creating a Module and decaring all your variables and stuff there. That way it can be accessed by any form in your project
    eg
    VB Code:
    1. '<In Module>
    2. Public StrLabel As String
    3.  
    4. '<In FrmOptions>
    5. Private Sub Command1_Click()
    6.     MsgBox StrLabel
    7. End Sub
    8.  
    9. '<In FrmMain>
    10. Private Sub Form_Load()
    11.     StrLabel = "Hello"
    12. End Sub

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2003
    Posts
    10

    Re: frmOptions

    So far the module level variables are working. I tried this a few days ago but I think I just defined them wrong... that and it was after a long day of work.

    Thanks for the quick reply

    If i get stuck again I know there are good people here

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Re: frmOptions

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post.

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