Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CAN'T GET TEXT TO SHOW IN TEXT BOX

Status
Not open for further replies.

TNN

Programmer
Sep 13, 2000
417
US
Help!!
I am stuck.
I have loaded an array of text boxes onto a form and have bound each textbox's datasource and datafield properties to a recordset. At design time each textbox's text property has in it "txt1". When the records from the recordset are loaded the "txt1" disappears but no text from the recordset is visible in the text boxes, just blank. I have verified that the database fields are not null but in fact contain text by viewing in Access. Any help is appreciated.
Thank You,
TNN, Tom
TNPAYROLL@AOL.COM [sig]<p>TOM<br><a href=mailto:WWW.TNPAYROLL@AOL.COM>WWW.TNPAYROLL@AOL.COM</a><br>[/sig]
 
It would help to see some code....there could be a multitude of problems why it isn't producing text. Are you sure by using datasource and datafield you have not confined yourself to the data you want involved?? I have done this on accident. [sig][/sig]
 
Hi JohnStep,
Thank You for your interest.
I am filling text boxes with code:
For n = 0 to 179 step 9
select case n
case 0,9,18 etc(array indexes)'begin row indexes
i=n
set txt1(i).datasource = rst
txt1(i).datafield = &quot;NAME&quot; 'field names
i=i+1
set txt1(i).datasource = rst
txt1(i).datafield = &quot;DEDNO&quot;
i=i+1
etc.......
end select
if rst.EOF = true then
exit for
else
rst.movenext
end if
next n

rst.close
set rst=nothing
set cmd = nothing
Using ADO to access database. My SQL query is good, it worked before I tried to fill text boxes.

ps: Not sure I understand what you were trying to tell me. Can you expand.
Thank You,
TNN, Tom
TNPAYROLL@AOL.COM





[sig]<p>TOM<br><a href=mailto:WWW.TNPAYROLL@AOL.COM>WWW.TNPAYROLL@AOL.COM</a><br>[/sig]
 
Hi JohnStep,

I have been playing with this.
If I do Not use the for loop and assign indexes to fill one row of text boxes everything works fine. As soon as I use the for loop there is no text showing in the boxes. I can't see anything wrong in the for loop.

Can you or anybody help.

Thanks,
TNN, Tom
TNPAYROLL@AOL.COM [sig]<p>TOM<br><a href=mailto:WWW.TNPAYROLL@AOL.COM>WWW.TNPAYROLL@AOL.COM</a><br>[/sig]
 
Hi JohnStep,
Found my problem. I was not setting the text box datasource properties to &quot;Nothing&quot; before doing &quot;MoveNext&quot;. Sometimes just helps to talk things over.
TNN, Tom [sig]<p>TOM<br><a href=mailto:WWW.TNPAYROLL@AOL.COM>WWW.TNPAYROLL@AOL.COM</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top