Selasa, 05 November 2013

Re: [MS_AccessPros] Dim Variable question

 

Andrew,

Thank You. I decided to give the controls names because there are so many on the form. But what you describe is what I was thinking of but could not figure it out. 
 
Jim Wagner



On Tuesday, November 5, 2013 8:29 AM, Andrew Wilson <andrew@adwsystems.co.uk> wrote:
 
Jim,
 
Giving the buttons generic names is usually ok, but if you want to give them functional names & achieve the same result, you could prefix each command button name with a specific character (say X) & then in a  For…Next loop iterate through each controll in the form and test the button name for the character and make Visible/Invisible as required.
 
e.g.
  Dim ctl As Control
'On Error Resume Next
  For Each ctl In Me.Section(0).Controls
     If (Left$(ctl.Name, 1) = "X") Then
        ctl.Visible =True
     End If
  Next ctl
 
Hope this helps.
 
Andrew


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

__,_._,___

Tidak ada komentar:

Posting Komentar