How to remove single quotes i.e. ' ' ????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishwaskothari
    New Member
    • Aug 2007
    • 60

    How to remove single quotes i.e. ' ' ????

    When we take some data of textbox or other controls from a FORM to DATAREPORT it comes with single quote.

    for eg: ' vishwas '

    I want that single quote should not be there

    so how can i remove it from the DataReport ?

    TIA

    with best regards
    vishwas
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    try to use the inbuilt replace function
    Syntax
    =========
    [CODE=vb]Replace(Express ion As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String[/CODE]

    Comment

    • vishwaskothari
      New Member
      • Aug 2007
      • 60

      #3
      Originally posted by debasisdas
      try to use the inbuilt replace function
      Syntax
      =========
      [CODE=vb]Replace(Express ion As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String[/CODE]

      thanks dear

      But its not working.

      i m asking about the starting and ending single quotes, that are originally not present in the text, but when we take the text from Textbox to the DataReport there are those single quotes (Gaurding the text , dont know from whom !!!!!!!!! )

      Comment

      • Dököll
        Recognized Expert Top Contributor
        • Nov 2006
        • 2379

        #4
        Originally posted by vishwaskothari
        thanks dear

        But its not working.

        i m asking about the starting and ending single quotes, that are originally not present in the text, but when we take the text from Textbox to the DataReport there are those single quotes (Gaurding the text , dont know from whom !!!!!!!!! )
        This should help get it wherever it is:

        [CODE=vb]

        Dim s1 As String
        s1 = Text6.Text

        s1 = Replace(s1, "'", " ")
        Text6.Text = s1

        [/CODE]

        It removes the single quote (') and adds an empty string (" ")Let's give that a whirl.

        Text6.Text is your multiline textbox by the way.

        Good luck!
        Last edited by Dököll; Sep 16 '07, 01:31 AM. Reason: Added remark...

        Comment

        • vishwaskothari
          New Member
          • Aug 2007
          • 60

          #5
          Originally posted by Dököll
          This should help get it wherever it is:

          [CODE=vb]

          Dim s1 As String
          s1 = Text6.Text

          s1 = Replace(s1, "'", " ")
          Text6.Text = s1

          [/CODE]

          It removes the single quote (') and adds an empty string (" ")Let's give that a whirl.

          Text6.Text is your multiline textbox by the way.

          Good luck!


          thanks dear !!!

          but its not working.

          Comment

          • vishwaskothari
            New Member
            • Aug 2007
            • 60

            #6
            Originally posted by vishwaskothari
            thanks dear !!!

            but its not working.

            is there anybody who can help me ?????

            Comment

            • creative1
              Contributor
              • Sep 2007
              • 274

              #7
              hi
              I never experience problem like this. I think if you store data in variable variable and then use it to print on report. It might help.

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                Hi,

                how are you passing the values of textbox from Form to the Label in the Datareport...?
                this works perfect here :

                [code=vb]
                DataReport1.Sec tions(2).Contro ls("Label1").Ca ption = Me.Text1.Text
                DataReport1.Ref resh
                DataReport1.Sho w
                [/code]

                Regards
                Veena

                Comment

                • vishwaskothari
                  New Member
                  • Aug 2007
                  • 60

                  #9
                  Originally posted by QVeen72
                  Hi,

                  how are u passing the values of textbox from Form to the Label in the Datareport...?
                  this works perfect here :

                  [code=vb]
                  DataReport1.Sec tions(2).Contro ls("Label1").Ca ption = Me.Text1.Text
                  DataReport1.Ref resh
                  DataReport1.Sho w
                  [/code]

                  Regards
                  Veena

                  i am doing exactly the same thing but its not working
                  here is my code



                  With DataReport1


                  Set .DataSource = rs
                  .DataMember = rs.DataMember

                  .Sections("Sect ion4").Controls ("lblName").Cap tion = "'" & Me.txtName.Text & "'"

                  End With


                  what can be the reason?

                  regards
                  vishwas

                  Comment

                  • QVeen72
                    Recognized Expert Top Contributor
                    • Oct 2006
                    • 1445

                    #10
                    Originally posted by vishwaskothari
                    i am doing exactly the same thing but its not working
                    here is my code



                    With DataReport1


                    Set .DataSource = rs
                    .DataMember = rs.DataMember

                    .Sections("Sect ion4").Controls ("lblName").Cap tion = "'" & Me.txtName.Text & "'"

                    End With


                    what can be the reason?

                    regards
                    vishwas

                    Hi,

                    You need not Wrap the Text with Single Quotes:

                    [code=VB]
                    .Sections("Sect ion4").Controls ("lblName").Cap tion = Me.txtName.Text
                    .Refresh
                    .Show
                    [/code]

                    REgards
                    Veena

                    Comment

                    • jamesd0142
                      Contributor
                      • Sep 2007
                      • 471

                      #11
                      try using the mid function to pick out the first and last characters and remove them.

                      Comment

                      Working...