Results 1 to 7 of 7

Assigning Text Box Event through Class to required Text Box

Threaded View

  1. #1
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Assigning Text Box Event through Class to required Text Box

    Hi All,

    I am need of suggestion/debug on below part of code, as i unable to understand why code is not assigning event.

    Query is i have 1 list box in that list for some value we required textbox and based on that label and textbox will visible and the position of label and text box is not fixed and for the last value of denied reason list we have 3 text box respectively and i want to add keydown event to that textbox below is the code for that.

    Click on EOP Notes tab --> Click on Denied reason and click on value from the list and for last 2 value we have text box and in that user will enter date, once user enter date the date format should be change to (dd-mmm-yyyy).

    '=======================Assigning Event to Multiple Text Box Events==========================
            lb = 0
            For i = 1 To 5
                If Frame3.Controls("Lbl" & i).Caption <> "" Then
                    If Frame3.Controls("Lbl" & i).Caption = "  Audit Closure (Member) - Please Enter Dates(mm/dd/yyyy)" Then
                        For j = 1 To 3
                            Set Obj = Frame3.Controls("TextBox" & i & j)
                            MsgBox Obj.Name
                            If TypeOf Obj Is MSForms.TextBox Then
                                TextBoxCounter = TextBoxCounter + 1
                                ReDim Preserve TextBoxes(1 To TextBoxCounter)
                                Set TextBoxes(j).TextBoxEvents = Obj 'at this line i am getting error
                            End If
                        Next
                    lb = lb + 1
                    End If
                End If
            Next
        '=============================================================================
    Attached Files Attached Files
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Simple Conditional Formating Help Required - If Blank then Red Bold text required
    By thilag in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-19-2014, 12:23 PM
  2. Replies: 11
    Last Post: 12-10-2012, 10:40 AM
  3. Copy Text to Text Box during Worsheet change event.
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2012, 09:07 AM
  4. Assigning value to text
    By Zan03 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-05-2010, 05:04 PM
  5. Assigning a 0 value to text
    By Steele in forum Excel General
    Replies: 3
    Last Post: 10-07-2008, 09:56 AM
  6. Assigning values to text - but displaying the text!
    By hudds in forum Excel General
    Replies: 4
    Last Post: 03-24-2007, 06:03 AM
  7. Assigning a value to a text
    By Eugine in forum Excel General
    Replies: 1
    Last Post: 03-13-2006, 07:31 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1