Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Removing Controls in Access forms using VB

Removing Controls in Access forms using VB

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reegan41
    wrote on last edited by
    #1

    I'm writing a small app in Access using VB. I need to loop through all of the control names in the form and then delete the one in which the control name is "Title", and which is a label. 'Suppose all declarations are already made' For Each ctl In frm.Controls If ctl.ControlType = acLabel Then If ctl.name = "Title" Then ctl.?????? - removing/deleting step End If End If Next ctl I don't know how to actually delete the controls. I can ADD controls and EDIT them OK, but deleting them is misleading me. Any ideas? Thanks.

    P C 2 Replies Last reply
    0
    • R reegan41

      I'm writing a small app in Access using VB. I need to loop through all of the control names in the form and then delete the one in which the control name is "Title", and which is a label. 'Suppose all declarations are already made' For Each ctl In frm.Controls If ctl.ControlType = acLabel Then If ctl.name = "Title" Then ctl.?????? - removing/deleting step End If End If Next ctl I don't know how to actually delete the controls. I can ADD controls and EDIT them OK, but deleting them is misleading me. Any ideas? Thanks.

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      reegan41 wrote:

      I'm writing a small app in Access using VB.

      That's not VB. It's Access VBA. Try posting your question in the SQL forum.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      C 1 Reply Last reply
      0
      • P pmarfleet

        reegan41 wrote:

        I'm writing a small app in Access using VB.

        That's not VB. It's Access VBA. Try posting your question in the SQL forum.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Actually, I've seen VBA questions here before. VBA is more VB than it is SQL, I'd say the problem is that we really don't have a 'right' forum for this question.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • R reegan41

          I'm writing a small app in Access using VB. I need to loop through all of the control names in the form and then delete the one in which the control name is "Title", and which is a label. 'Suppose all declarations are already made' For Each ctl In frm.Controls If ctl.ControlType = acLabel Then If ctl.name = "Title" Then ctl.?????? - removing/deleting step End If End If Next ctl I don't know how to actually delete the controls. I can ADD controls and EDIT them OK, but deleting them is misleading me. Any ideas? Thanks.

          C Offline
          C Offline
          ChandraRam
          wrote on last edited by
          #4

          reegan41 wrote:

          For Each ctl In frm.Controls If ctl.ControlType = acLabel Then If ctl.name = "Title" Then ctl.?????? - removing/deleting step End If End If Next ctl

          Just guessing... but isn't frm.Controls a collection? If so, you should be able to delete from it?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups