DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: text boxes

  1. #1
    Join Date
    May 2004
    Posts
    52

    text boxes

    hello
    i am trying to popluate a dozen text boxes on a form with data from db
    db has two fields (id,name) with 32 entries
    i only want the name to appear in the text box
    i am using ADO and i can only get the first value in the field to appear in all the text boxes
    i am using the adCmdTable as a recordsource
    i think i need to us a SQL statement here , as i need each text box to contain a different entry

    any advice would be helpful
    thank you

    Mac

  2. #2
    Join Date
    Apr 2005
    Location
    Pasig, Phil.
    Posts
    8
    You can create an array of text boxes, make a looping statement to get the value and insert it to the text boxes.

    Example of an array of text boxes:
    http://www.littlebeeps.com/Tutorials...Something.html

  3. #3
    Join Date
    May 2004
    Posts
    52

    dont laugh , it works

    hello
    thank you surlaw for the advice and link
    i am afraid i did not gather much from it tho
    what i have been able to do so far is add an adodc for each text box i am trying to populate, use adcmdtxt and use this sql statement
    SELECT * FROM TEAMS WHERE TEAMID = "3" (new number for each record)
    this poplulates the text box with the indiviual names i want, but i am sure there is a better/faster/smarter way to do this
    i have been all over the net looking for tutorials on looping and other methods, but have not been able to find anything( that i could make sense of). so now that i have provided you with a good giggle with my tale of woe.
    any suggestions or advice would be most welcome

    Thank you

  4. #4
    Join Date
    Apr 2005
    Location
    Pasay & Candon City, I.S., Phils.
    Posts
    22
    You could use control array like this

    Code:
    For a = 0 to txtData.count-1
    txtdata(a)=adoRecordset.Recordset.Fields(a)
    next

  5. #5
    Join Date
    May 2004
    Posts
    52

    text box

    hello dee-u
    thanks for the reply
    i am not sure i follow you tho ,where am i putting that
    code in?

    Mac

  6. #6
    Join Date
    Apr 2005
    Location
    Pasig, Phil.
    Posts
    8
    you can put dee-u's code in the form1(form1.frm) or whenever/whereever you want those records to display on your form.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center