Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Unanswered: Cycle through each control on a form

    How would I code up a module that would cycle through each control on a form and lock it?
    I imagine it would be some sort of 'for each' loop along with me.controls

    on a side note...
    Can I cycle through each form and then cycle through each control nested inside of that?


  2. #2
    Join Date
    Mar 2004
    Public Sub CycleThroughControls(frmObject As Form, blnEnabled As Boolean)
    Dim ctrlObject As Control
    On Error Resume Next 'Not All Controls have an Enabled Property
    For Each ctrlObject In frmObject
        ctrlObject.Enabled= blnEnabled
    Next ctrlObject
    End Sub

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts