more than 250 characters in a textbox?

elephant_manelephant_man Member Posts: 6
is it possible to put a textbox on a form and set its value like first 250 characters to field1 and the other 250 character to field2 (both fields are in same table) ?

or is there a way to show 500 characters in a textbox and after update it, it seperate as 2 variables and one goes to a field the other one goes to another field?

Thanks

Comments

  • BBlueBBlue Member Posts: 90
    Hello,

    Yes it is possible. You can have the following situations:
    1) Textbox having text variable of length 500 as SourceExpression and OnValidate you split the string and assign it to the two table fields
    2) 2 texboxes on the form one above the other, both with "Border" property set to "No.", having as SourceExpression the 2 fields from the table.

    Regards.
    //Bogdan
  • AlbertvhAlbertvh Member Posts: 516
    Hi
    Yes you can do this.

    in AfterGetrecord of the form

    MyText := Field1 + Field2;

    In AfterValidate

    Field1 := COPYSTR(MyText,1,250);
    Field2 := COPYSTR(MyText,250);

    declare MyText as Type Text of length 500



    Albert
  • BeliasBelias Member Posts: 2,998
    don't kill me for this :mrgreen:

    you can do it with or without coding...i think it is better without coding...even if a little "ugly" for some aspects...
    create one long textbox, with focusable = no and soruceexpr = it doesn't care

    put the 2 textboxes one near the other...i mean 0pt between them.they must perfectly cover the long textbox you created before

    then modify this property for each textboxes (2):

    Border =no
    sourceexpr = the two fields, one per textbox

    then modify this property of the leftmost textbox
    -autoenter = yes
    -nextcontrol = the ID (or the name, i don't remember) of the rightmost textbox

    if you have to manage the editability of field 2 in function of the field 1 (e.g. use f2 only if f1 is longer than 250, let me know)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    That's really marvellous, Belias! :mrgreen:
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • BeliasBelias Member Posts: 2,998
    thanks! :mrgreen:
    i thought to it when i was thinking about how to simulate "real" multiline feature...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • elephant_manelephant_man Member Posts: 6
    ok thanks for everyone i prefer this one:
    Albertvh wrote:
    Hi
    Yes you can do this.

    in AfterGetrecord of the form

    MyText := Field1 + Field2;

    In AfterValidate

    Field1 := COPYSTR(MyText,1,250);
    Field2 := COPYSTR(MyText,250);

    declare MyText as Type Text of length 500



    Albert
Sign In or Register to comment.