• Format a variable (A2KSR1)

    Author
    Topic
    #362048

    Is it possible to format a variable that has been inserted into a string statement. eg.
    Strmessage = “‘” & NewData & “‘ will have to be added to our database. Proceed?”
    NewData will be a phone number without the hyphen but I would like it to show in this statement with the hyphen.

    Viewing 0 reply threads
    Author
    Replies
    • #548982

      Strmessage = “‘” & Format(NewData,”@@@-@@@@”) & “‘ will have to be added to our database. Proceed?”

      • #548984

        What?! I tried Strmessage = “‘” & Format(NewData,”000-0000″) & “‘ will have to be added to our database. Proceed?” prior to posting but it didn’t work! I must have screwed up on the syntax. Thanks Charlotte.

        • #548989

          Check out the example file that I posted to your question about the combo boxes. It has a combo box with the format() function in it.

          J

        • #548990

          It is probably your use of ‘0’s in your format function.

          If your phone numbers are all the same length, ie 3 digits then hyphen then 4 digits then use the ‘@’ symbol. If you have some phone numbers with area codes and some without (ie. some 04387-3333 and some 387-3333) then you will want to use the ‘&’ symbol in your format function.

          J

    Viewing 0 reply threads
    Reply To: Format a variable (A2KSR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: