Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

VB Command Buttons

  • 03-06-2003 2:49pm
    #1
    Closed Accounts Posts: 1


    Hi
    I'm trying to get VB command button to appear on ever tab of an already created VB application. There are 10 tabs and I want the same code to be used for the button on each tab with same button appearin gon each.
    Any advice would be really appreciated.
    Thanks in advance:)


Comments

  • Closed Accounts Posts: 1,502 ✭✭✭MrPinK


    Been a while since I did any VB, but if I remember correctly, you can create a command button on the form and then move it on top of the tabs. It's not part of any of the tabs, so switching between them will still leave the command button in the same place.

    Alternatively, you could have 10 buttons and have 9 of them just call the first one so they do the same thing. Or a control array would be even easier.


  • Closed Accounts Posts: 2,313 ✭✭✭Paladin


    Not sure if what Mr Pink said would work if you are switching between forms. What Id do (because it would mean less work finding out a better way) is have a command button on each form call a *Public* sub, ie

    command1_click()
    Call MySub()

    End sub

    Public Sub MySub()
    Code Here
    End Sub

    Actually, Mr Pink is probably right as long as the original sub is public :/
    Same thing I guess :)


Advertisement