Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2007, 06:43 AM
Authorized User
 
Join Date: Jun 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get all user data from ALL dynamic textboxes

How do i get all user data from ALL dynamic textboxes in a form.

Thanks!!!

Regards.

 
Old May 30th, 2007, 11:46 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Something... like this.

Dim tb(1) As TextBox

Private Sub Command1_Click()
With tb(0)
    .Visible = True
    .Top = 300
    .Left = 300
End With

With tb(1)
    .Visible = True
    .Top = 1000
    .Left = 300
End With


End Sub

Private Sub Command2_Click()
MsgBox tb(0).Text
End Sub

Private Sub Form_Load()
Set tb(0) = Me.Controls.Add("VB.TextBox", "tb0")
Set tb(1) = Me.Controls.Add("VB.TextBox", "tb1")
End Sub

Hope this helps

With Regards,
Raghavendra Mudugal
 
Old May 31st, 2007, 05:32 AM
Authorized User
 
Join Date: Jun 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, but i was thinkin in linie of (not using array)

for each TEXTBOX in FORM1

next

Thanks.

 
Old May 31st, 2007, 07:03 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here... is this what you were looking for?
(w.r.t. my above logic in the command2_click.. add these lines there)

For Each obj In Me
    If TypeOf obj Is TextBox Then
        s = s & obj.Text & "; "
    End If
Next
MsgBox s

hope this helps.

With Regards,
Raghavendra Mudugal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataform with textboxes to load without data Bjay VB Databases Basics 0 August 1st, 2007 12:14 PM
help writing dynamic form data to dynamic table ublend SQL Server ASP 1 June 1st, 2007 08:09 AM
About dynamic textboxes data capturing chandra_yvr ASP.NET 2.0 Basics 5 March 30th, 2007 09:58 AM
creating dynamic textboxes djricochet ASP.NET 2.0 Professional 0 March 14th, 2006 12:04 PM
Store Data From textboxes which form Table gadhiav ASP.NET 1.0 and 1.1 Basics 7 June 30th, 2004 11:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.