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!

Autoexpand TextBox depending on field value?

Status
Not open for further replies.

slaman

Programmer
Jun 8, 2001
47
CA
Hello,

I have a field that can be any length. I specified a size for the text box, but is there a way to make this box "grow (vertically)" appropriately according to the size of the field? Plus after it "grows", how can I shift everything else below down? I'm hoping that there is a simple way to approach this, but I'm fearing that some hardcore coding will be involved...
 
Have you tried changing the text box properties Can Grow and Can Shrink to yes?
Sera
 
Yes, but this doesnt allow it to shift everything below down when it does "grow" or shrink...

I'm thinking maybe I might have to do some sort of SpreadSheet style thing...
 
Maybe you could use a subform for that particular field....Otherwise I don't know and I am ruining your chances of getting a helpful response.
Sera
 
Im thinking I could use a

For Each statement, and me.controls and moveup (or whatever the corresponding function is called)

But the problem I am encountering is how to limit the ForEach to fields BELOW the existing field?
 
Slaman, I think you are possibly making this more difficult than it needs to be. I would repost this question on the Forms forum, and also the General Discussion Forum. I will resist the urge to post anything on it. I don't think you are getting any other responses because it looks like we have solved your problem. I am very interested in seeing the answer. I am not sure that what you are trying to do is really necessary though. Why are you going to all that work to move all of the other controls on your form when you could make the text box larger than it normally needs to be and if the text is more than the control size the user can just cursor down and see the rest of the text?
Sera
 
I will post to another thread. And the reason I am doing this is because I need to make a PRINTABLE summary form. This summary MUST fit on one page. If one of the fields is blank, I don't want it to show up on this summary. I know I could do an

If IsNull([TextField]) Then
TextField.Visible = False
End If

but that would just make the field invisible, and the result would be a blank space on the form. I want that space to be filled with the next field. I'm not sure how else I can describe this.
 
And you can't use a report to do this instead of printing the form?
Sera
 
I want the user to be able to view this summary as a Form on the computer to make sure things look properly before printing. A report will not allow me to do all the things I want to do with this summary... I may be wrong though, any suggestions would be appreciated.
 
you can create a preview button on the form that will allow the user to preview the report before they print it. I am pretty sure that a report is the answer to this problem. You can do alot more with reports and it is a lot easier than trying to manipulate the forms. If you would like me to help you create a report maybe we should be corresponding via e-mail instead of over this forum. E-mail me at
whitse@inel.gov if you would like me to help you further. If not, really look into reports, I am sure that is the answer to your problem.
Sera
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top