Results 1 to 4 of 4

Thread: Text box text adding extra space at end when saving to dB

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    89

    Text box text adding extra space at end when saving to dB

    This is happening on only one out of about 20 forms that I have created...and I cannot pinpoint the reason for it...but would be interested in a possible solution.

    I have appx. five text fields that are adding a space to the end of the string.

    For example, I get some data like this: "myname "

    See how there is a space at the end of the letter e? It is only occuring on this one form. Any ideas on how to get rid of this? Would a trim do the trick? Thanks in advance.

    TempDyna.AddNew
    TempDyna("User_name") = ConWriteID
    TempDyna("F_name") = TxtFName.Text
    TempDyna("L_name") = TxtLname.Text
    TempDyna("Buyer_cd") = TxtUserCode.Text
    TempDyna("admin_yn") = chkCWadmin.Value
    TempDyna("Term_id") = TxtTermId.Text
    TempDyna("ofc_symbol") = TxtOfficeSymbol.Text
    TempDyna.LockEdits = False
    TempDyna.Update

  2. #2
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Belgium/Antwerp
    Posts
    275
    As you said, a trim will do the trick:

    TempDyna.AddNew
    TempDyna("User_name") = ConWriteID
    TempDyna("F_name") = trim(TxtFName.Text)
    TempDyna("L_name") = trim(TxtLname.Text)
    TempDyna("Buyer_cd") = trim(TxtUserCode.Text)
    TempDyna("admin_yn") = chkCWadmin.Value
    TempDyna("Term_id") = trim(TxtTermId.Text)
    TempDyna("ofc_symbol") = trim(TxtOfficeSymbol.Text)
    TempDyna.LockEdits = False
    TempDyna.Update

    Luc,

  3. #3
    Fanatic Member Bonker Gudd's Avatar
    Join Date
    Mar 2000
    Location
    Saturn
    Posts
    748
    Trim will do it.

    Check that the .Text attributes are empty on the saved form.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    89

    Found my problem

    For some reason I had set all those text boxes to = " " instead of just "" when the user wanted to add a new user. Geez...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width