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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box won't grow

Status
Not open for further replies.

kmayo503

MIS
Jun 21, 2003
70
US
i have a text box on a form that won't let me add more than 50 characters. i have set it to yes in can grow, but that doesn't change anything. i have checked out every setting in properties and there is nothing set to this in visual basic. i tried to add an unbound text box and it didn't work. it didn't make a difference. any thoughts would be greatly appreciated.
 
What happens when you go past 50?

And...what is the data type to which the box is bound and will it allow more than 50 chars?

-Chris
 
The Can Grow and Can Shrink properties are for the "VIEWING" and "PRINTING" of reports and forms. Not for data entry.

Here is some code I used once to expand a text box as I typed data into it. The textbox I had would show about 20 chars. This expanded it if I went over 20. This was a weird request for a client, I guess others need it also.

Hope this helps...



Private Sub Text0_KeyPress(KeyAscii As Integer)

If Len(Text0.Text) > 20 Then
Text0.Width = Text0.Width + 75
Me.Repaint
End If

End Sub

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
i added that to the code and changed the name to notes and it didn't make a difference. any other suggestions?
 
How did you add it? Did you just paste it? Did you check to see if there was an [EVENT PROCEDURE] indicated in the Key Press event for the text box?

Just curious?

Also, may I ask why you need it to expand? Maybe there are other solutions?


ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Is the text box linked to a data field whose limit is set to 50 characters?

Brian
 
i opened the form in design view. went to code builder and set it up as a key press event proceedure. in properties thats what it says.
Private Sub notes_BeforeUpdate(Cancel As Integer)
If Len(Notes) > 20 Then
Notes.Width = Notes.Width + 75
End If
End Sub
its a notes section. sales reps are adding comments about the records. i've added them before, but they were predone in a template. this is custom built.
 
i am such as fool i didn't even think to look there. i need s break. thank you so much for pointing out the obvious. so sorry i didn't think of something that simple myself.
 
You can also change the 'data type' in the design view of the table to memo vs. text. A Memo field can store up to 65,536 characters.

Christina

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top