Results 1 to 2 of 2

Thread: Form

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    Form

    Hi everyone,
    I have this program where I am using a special Active X control to do the scrolling of items on each form. I really don't want to go through the repetition of Select Case structures in order to do the scrolling so what I am doing is that I have this variable called frmForm and it is declared as var type Form. I am trying to assign the Form names of the different forms to store the name of the current form. Its like this:

    VB Code:
    1. ' In a seperate module
    2. Public frmForm As Form
    3.  
    4. ' When the main form loads
    5. Private Form_Load()
    6.       frmForm = frmMain
    7. End Sub
    8.  
    9. ' In The Active X Control
    10. Private Sub UserControl1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    11.     frmForm.lblComponent(0).BackColor = vbBlue
    12. End Sub

    Here I get a "Type Mismatch" Error when in the line frmForm = frmMain

    Is there any way to help me out here...? Anyone..?

    Any help would be appreciated
    Hey... If you found this post helpful please rate it.

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: Form

    Try prefixing with 'Set'

    Eg: Set frmForm = frmMain

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