Selasa, 05 November 2013

[MS_AccessPros] Dim Variable question

 

Hello all,


I am struggling with a vba question.

I have a form that has multiple buttons that are hidden by default. With the click of a button the buttons are made visible. There are 21 of them. I have learned about For Next and declaring a variable, but I am trying to take it a step further. Currently I have the code to list every button name and the visible property to true when the user clicks the main button. But I see that listing every button name is a lot of typing. For aesthetics I have the button and a smaller button with an arrow on it next to it. The smaller buttons have a name of cmdArrowDelete1 down to 21. 
The code right now is below and it works great. But I would like to add the other buttons to the code. I have the names with names such as cmdDelete1Accounts and cmdDelete2Accruals. 
How can I add the buttons to the For next so they will appear like the other buttons?

Thank You 
Jim Wagner

Dim i As Integer

For i = 1 To 21
    Me("cmdArrowDelete" & i).Visible = True
    Next

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar