How to Assign two text boxes to another text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Venu gopal
    New Member
    • Jul 2006
    • 3

    How to Assign two text boxes to another text box

    I am getting month and year in two text boxes but I want to both in one text boxe. I have tried using both ways but I have faield.
    Example: 012006
    'MonthYear = "imonth" & "iyear"
    Month3.Text = imonth & iyear

    'Month3.Text = (month1.Text & Year1.Text)

    Please any suggestions that would be great help.
    Thanks.

    --------------------------------------------------------------------------------
  • RaulSerr
    New Member
    • Jun 2006
    • 4

    #2
    If I understand your question correctly try something like this:

    Month1.text = imonth
    Year1.text = iyear
    Month3.text = (month1.text & Year1.text)

    Comment

    • sashi
      Recognized Expert Top Contributor
      • Jun 2006
      • 1749

      #3
      Hi Venu,

      RaulSerr is correct.. maybe a little bit of formatting will tidy up things..

      Code:
      Month1.text = imonth
      Year1.text = iyear
      Month3.text = Trim(Month1.text) & "/" &  Trim(Year1.text)
      see below example..
      Trim Trailing or Leading Blanks / Whitespace from a String

      Use the Visual Basic functions LTrim, RTrim, and Trim to trim whitespace from a string.

      Code:
      MyString = "   Some Text   "
      
      Print LTrim(MyString)     ' prints "Some Text   "
      Print RTrim(MyString)     ' prints "   Some Text"
      Print Trim(MyString)     ' prints "Some Text"

      Comment

      • Venu gopal
        New Member
        • Jul 2006
        • 3

        #4
        Thanks very much Raulserr and Sashi its working fine.

        Comment

        Working...