[AccessD] OT - Looping Through Controls on Visual BasicForm

Paul Hartland (ISHARP) paul.hartland at isharp.co.uk
Wed Jun 8 09:35:52 CDT 2005


Thanks ever so much, makes my life so much easier

Paul Hartland 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Randall R Anthony
Sent: 08 June 2005 13:03
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] OT - Looping Through Controls on Visual BasicForm

Paul,
This is what I'm currently using to do just what you described.  I'm sure it
can be manipulated to search on specific control names, although I have not
done it because I don't need the specificity.

For Each cCtrl In frmFormName.Controls
            If TypeOf cCtrl Is TextBox Then
                cCtrl.Locked = True
            End If
            If TypeOf cCtrl Is ComboBox Then
                cCtrl.Locked = True
            End If
            If TypeOf cCtrl Is DBGrid Then
                cCtrl.AllowAddNew = False
                cCtrl.AllowDelete = False
                cCtrl.AllowUpdate = False
            End If
        Next
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list