By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

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

P: 60
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
Sep 15 '07 #1
Share this Question
Share on Google+
10 Replies


debasisdas
Expert 5K+
P: 8,127
try to use the inbuilt replace function
Syntax
=========
Expand|Select|Wrap|Line Numbers
  1. Replace(Expression As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String
Sep 15 '07 #2

P: 60
try to use the inbuilt replace function
Syntax
=========
Expand|Select|Wrap|Line Numbers
  1. Replace(Expression As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String

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 !!!!!!!!! )
Sep 15 '07 #3

Dököll
Expert 100+
P: 2,364
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:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim s1 As String
  3.   s1 = Text6.Text
  4.  
  5.   s1 = Replace(s1, "'", "  ")
  6.   Text6.Text = s1
  7.  
  8.  
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!
Sep 16 '07 #4

P: 60
This should help get it wherever it is:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim s1 As String
  3.   s1 = Text6.Text
  4.  
  5.   s1 = Replace(s1, "'", "  ")
  6.   Text6.Text = s1
  7.  
  8.  
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.
Sep 16 '07 #5

P: 60
thanks dear !!!

but its not working.

is there anybody who can help me ?????
Sep 18 '07 #6

100+
P: 274
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.
Sep 18 '07 #7

QVeen72
Expert 100+
P: 1,445
Hi,

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

Expand|Select|Wrap|Line Numbers
  1.     DataReport1.Sections(2).Controls("Label1").Caption = Me.Text1.Text
  2.     DataReport1.Refresh
  3.     DataReport1.Show
  4.  
Regards
Veena
Sep 18 '07 #8

P: 60
Hi,

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

Expand|Select|Wrap|Line Numbers
  1.     DataReport1.Sections(2).Controls("Label1").Caption = Me.Text1.Text
  2.     DataReport1.Refresh
  3.     DataReport1.Show
  4.  
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("Section4").Controls("lblName").Caption = "'" & Me.txtName.Text & "'"

End With


what can be the reason?

regards
vishwas
Sep 18 '07 #9

QVeen72
Expert 100+
P: 1,445
i am doing exactly the same thing but its not working
here is my code



With DataReport1


Set .DataSource = rs
.DataMember = rs.DataMember

.Sections("Section4").Controls("lblName").Caption = "'" & Me.txtName.Text & "'"

End With


what can be the reason?

regards
vishwas

Hi,

You need not Wrap the Text with Single Quotes:

Expand|Select|Wrap|Line Numbers
  1.      .Sections("Section4").Controls("lblName").Caption = Me.txtName.Text 
  2.     .Refresh
  3.     .Show
  4.  
REgards
Veena
Sep 18 '07 #10

jamesd0142
100+
P: 469
try using the mid function to pick out the first and last characters and remove them.
Sep 18 '07 #11

Post your reply

Sign in to post your reply or Sign up for a free account.