Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

    Unanswered: Finding object type

    Silly little question; How do I determine what type an object is? Textbox, label etc
    Currently using the following code
    Code:
    Dim Ctl As Control
    
    For Each Ctl In Me.Controls
                If IsNull(Ctl.Value) Then
                            MsgBox(“You need to enter some values, dumbass”) ':)
                            Exit Sub
                EndIf
    Next Ctl
    But I want to only loop through textboxes... So I figured there must be a way of identifying what the object type is? I have a funny feeling I've seen this here bfeore but I can't find it for the life of me!

    Thank you kindly,
    George
    George
    Home | Blog

  2. #2
    Join Date
    Nov 2002
    Posts
    272
    Does Ctl.ControlType return anything useful?

  3. #3
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    If IsNull(Ctl.Value) and ctl.ControlType = acTextBox then

    ??


    MTB

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    That's the badger Thanks badgers!
    George
    Home | Blog

Posting Permissions

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