Brad Marks
BradM at blackforestltd.com
Fri Mar 29 16:41:00 CDT 2013
Jim, Jack, Paul, Thanks for the help with this question. I now have a working example. I appreciate the assistance. You guys are great! Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland Sent: Friday, March 29, 2013 4:30 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] How To Make All Controls on a Form Invisible I usually loop through the controls, just done a quick test created a form called Form1, then added three buttons named Button1, Button2, Button3 and put the following code in the open event, Dim ctrls As Control For Each ctrls In Forms("Form1").Controls If ctrls.Name = "Button2" Then Me(ctrls.Name).Visible = False End If Next Paul On 29 March 2013 21:25, Jim Dettman <jimdettman at verizon.net> wrote: > > You can do it by section: > > Me.Detail0.Visible = False > > Otherwise, you'll need to loop through the forms control collection. > > Jim. > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks > Sent: Friday, March 29, 2013 04:59 PM > To: Access Developers discussion and problem solving > Subject: [AccessD] How To Make All Controls on a Form Invisible > > All, > > We have an Access 2007 application that has a form which contains many > controls (buttons). > > This application is now going to be placed on a PC where the user is > only suppose to see only 1 button. > > Is there an easy way in VBA to make all buttons on the form invisible. > (This would be followed by a single line of code to make the single > button visible for this specific user.) > > Thanks, > Brad > > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- Paul Hartland paul.hartland at googlemail.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.