MultiPage Click Event

Discussion in 'AutoCAD' started by Randy Richardson, May 21, 2004.

  1. I am trying to create sub that fires when a tab on a MultiPage is fired.
    However, when I try to run the program I get the following error:

    Compile error:
    Procedure declaration does not match description of event or procedure
    having the same name.

    Here's my code:

    Private Sub MultiPage1_Click(i As Long)
    End Sub

    What am I doing wrong?

    Thanks,

    Randy
     
    Randy Richardson, May 21, 2004
    #1
  2. When a MultiPage is clicked, that is.
     
    Randy Richardson, May 21, 2004
    #2
  3. When I put a MultiPage on a VBA Userform and click on it, I get the
    following sub declaration. Does this solve your problem?


    Private Sub MultiPage1_Click(ByVal Index As Long)
    End Sub

    hth,
    James
     
    James Belshan, May 22, 2004
    #3
  4. Looks like I was missing "ByVal." Thanks, James, I'll try that when I get
    back work.

    -Randy
     
    Randy Richardson, May 22, 2004
    #4
  5. Randy Richardson

    wivory Guest

    Hmmm...I'm completely guessing here, but maybe your parameters don't match what's expected. Try temporarily cutting your code out, then double-click on the MultiPage1 object so it automatically generates the event header for you (if the default event is not Click then choose Click from the event dropdown list). See if the generated parameters match what you had previously.

    Hope this helps.

    Regards

    Wayne Ivory
    IT Analyst Programmer
    Wespine Industries Pty Ltd
     
    wivory, May 24, 2004
    #5
  6. I've confirmed it now. I was missing "ByVal." It was missing from the
    "help" file explanation, and there was no example. Thanks for helping.
    It's working just fine now.
     
    Randy Richardson, May 24, 2004
    #6
  7. It looks like that was what James did. I did try clicking on the MultiPage1
    object as you suggest, but instead of getting the Click event I got the
    Change event. I suppose that would have worked fine if it didn't blank out
    everything on the page. That's a whole 'nuther issue, I guess, or would be
    if I was stuck with using the Change event. Anyway, I got it working now.
    I am not familiar with the event dropdown list. I don't know how to make it
    appear. Not that that matters to me any more, since the Click event is
    working for me now.

    -Randy

    what's expected. Try temporarily cutting your code out, then double-click
    on the MultiPage1 object so it automatically generates the event header for
    you (if the default event is not Click then choose Click from the event
    dropdown list). See if the generated parameters match what you had
    previously.
     
    Randy Richardson, May 24, 2004
    #7
  8. Randy Richardson

    wivory Guest

    I'm glad you got it working.

    To clear up about the event dropdown list, when you clicked on the MultiPage1 object and got the Change event, you would've seen above the code a box with the word "MultiPage1" on the left, and another with the word "Change" on the right. The one on the right is the event list, and if you clicked the dropdown arrow next to the box you would see the list of all possible events for this object. Choosing one of them (such as Click) would generate the template code for that event.

    Regards

    Wayne
     
    wivory, May 25, 2004
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.