multiple lines in a text box
multiple lines in a text box
(OP)
I've seen what I want in other programs but I'm not sure what it is. It appears to be a textbox with multiple rows and columns. I want to display 2 columns of numbers with as many rows as I need to dislay. A scollbar on the side allows the user to scroll to the position they want and change any data they need to modify. If each cell has a border it would be easier to see the divisions. Any idea what i need?





RE: multiple lines in a text box
What program and version?
Are you trying to add this control to a form, or are you trying to add this to a spreadsheet or other type of environment?
If you are working in a customized form then you might embed an excel spreadsheet into the form. You do this by right-clicking on the toolbox of form controls, select Additional Controls, then scroll down until you find Microsoft Office Spreadsheet ##.#. A new icon will appear in your toolbox pallete. It may also be the Microsoft Flexgrid Control. The flexgrid is usually bound to a database, but I think there is a way to use it without binding. My license does not allow use of the flex grid control, so I can't help you beyond that statement. The danger of adding new fancy controls to your toolbox is that not everyone else has the right DLL or OCX files, or you might run into licensing restrictions. If everyone using your control is on the same version and same license then you should be okay.
The third option is to build your own grid of textboxes. The object you are talking about may be a user-defined active X control. VBA does not allow use of user-defined active X controls. You can get around this by creating your own grid of text boxes and writing code to edit the form and the VBA module itself. This requires the user to grant trusted access to the VBA module in the macro security settings. If you don't want to get into macros that edit VBA code then you could just hide text boxes until the user needs to see them.
-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
RE: multiple lines in a text box
I looked up the Flexgrid Control that yopu mentioned and it would be great, but I don't think it's availalbe in VBA.
I already have a grid (2 width by 20 high) of text boxes that is doing about what I want, but the user would like to be able to scroll. By the way, you gave a very good detailed reply to my question that really helped a lot. Thanks!
RE: multiple lines in a text box
-handleman, CSWP (The new, easy test)
RE: multiple lines in a text box
"FATAL ERROR:Unhandled Access Violation Reading 0x00a4 Exception at 3706f3dh."
I also tried in Excel and got a "Class Not Registered" error message. I guess I either don't have the dll on my computer or I need to do the regsvr32 command at the START button. Any ideas?
RE: multiple lines in a text box
I thought about that too, but I didn't think a list view would let you type data into the cells. Have you been able to do this yourself? I only have limited experience with them.
jrice174,
I'm guessing that an embeded excel sheet is going to be the most practical option. You might try taking your question over to www.tek-tips.com/ A lot of guys over there will have more experience with highly customized forms.
-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]