Jim
I usually use the .Tag property for grouping controls.The .Tag property is just a string that you can use as an identifier for lots of things. And using For Each loops lets you do it without knowing the count.
Dim ctrl As Control
For each ctrl in me.Detail.Controls
Ctrl.Visible = (ctrl.Tag = "ShowMe")
Next
You can even go one step further and use a delimiter and break the tag into an array.
'Here the tags are strings like "ShowMe|Delete" or "ShowMe|Update"
Dim ctrl As Control
Dim aryList As Variant
aryList = Split(ctrl.Tag, "|")
For each ctrl in me.Detail.Controls
Ctrl.Visible = (aryList(0) = "ShowMe")
Ctrl.Caption = aryList(1)
Next
Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com
---In MS_Access_Professionals@yahoogroups.com, <luvmymelody@yahoo.com> wrote:
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (3) |
Tidak ada komentar:
Posting Komentar