Results 1 to 3 of 3
  1. #1
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16

    multiple textbox in a form

    Hi all


    Please help me in coding access 2003 form, I have 25 text boxes in a form (Text1, Text2, Text3..Text25)

    I want go through all the textboxes in a loop and find lenght of the each Text field and add new numbers to the textbox field value.

    Did many ways, did nt go any where. Please help.

    Thanks
    Last edited by iamraja5; 01-21-2010 at 11:19 AM. Reason: typo

  2. #2
    MichelleNZ is offline Novice
    Windows Vista Access 2003
    Join Date
    Nov 2009
    Location
    Hamilton, New Zealand
    Posts
    2
    The following code loops through all the textboxes on a form and displays a message of the name, value and length. Hopefully this will get you started

    Private Sub Command11_Click()
    Dim myCtl As Control

    For Each myCtl In Me.Controls
    If TypeOf myCtl Is TextBox Then
    MsgBox myCtl.Name & " : " & myCtl.Value & " : " & Len(myCtl.Value)
    End If
    Next

    End Sub

  3. #3
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16
    Quote Originally Posted by MichelleNZ View Post
    The following code loops through all the textboxes on a form and displays a message of the name, value and length. Hopefully this will get you started

    Private Sub Command11_Click()
    Dim myCtl As Control

    For Each myCtl In Me.Controls
    If TypeOf myCtl Is TextBox Then
    MsgBox myCtl.Name & " : " & myCtl.Value & " : " & Len(myCtl.Value)
    End If
    Next

    End Sub
    Working the way I expted. Very nice work. Thanks alot.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Trying to create multiple records from a form
    By ed_hollywood in forum Forms
    Replies: 4
    Last Post: 04-02-2010, 10:57 PM
  2. Update Multiple tables from one form
    By KenK in forum Forms
    Replies: 0
    Last Post: 10-30-2009, 08:44 PM
  3. Replies: 3
    Last Post: 03-28-2009, 06:06 PM
  4. Replies: 1
    Last Post: 03-02-2009, 11:54 AM
  5. Replies: 1
    Last Post: 08-10-2008, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums