473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Missing double quote after string - HELP!

My function to populate fields on a form from a collection:

Private Sub cbfSetUpAddresses(ByVal pcolAddress As Collection)

Line 1 Me.txtAddress1.Text = pcolAddress(1).ToString
Line 2 Me.txtAddress2.Text = pcolAddress(2).ToString
Line 3 Me.txtAddress3.Text = pcolAddress(3).ToString
Line 4 Me.txtAddress4.Text = pcolAddress(4).ToString
Line 5 Me.txtPostCode.Text = pcolAddress(5).ToString

Line 6 End Sub

The Postcode text box is corrupted. As well as containing the correct
data it also contains a bunch of trailing stuff from another field.

If I look at these values in a Watch window, I notice the following:

At Line 1 in the function the value of Me.txtPostCode.Text = "GL5 4RT"
At Line 1 in the function the value of pcolAddress(5).ToString = "GL5
4RT"
At Line 6 in the function the value of Me.txtPostCode.Text = "GL5 4RT

NOTE THE MISSING " AT THE END.

The text box then displays:

GL5 4RTershire

Incidentally, the " is missing from all the populated text boxes, but
it only corrupts the display in the Postcode text box.

I tried this:

Dim strTemp As String = ""
strTemp = Trim(pcolAddress(5).ToString)
Me.txtPostCode.Text = strTemp.ToString

but it made no difference.

Clearly there are dark forces at work. Can anyone help?

TIA

Edward
Nov 20 '05 #1
2 2153
* te********@hotmail.com (Edward) scripsit:
My function to populate fields on a form from a collection:

Private Sub cbfSetUpAddresses(ByVal pcolAddress As Collection)

Line 1 Me.txtAddress1.Text = pcolAddress(1).ToString
Line 2 Me.txtAddress2.Text = pcolAddress(2).ToString
Line 3 Me.txtAddress3.Text = pcolAddress(3).ToString
Line 4 Me.txtAddress4.Text = pcolAddress(4).ToString
Line 5 Me.txtPostCode.Text = pcolAddress(5).ToString

Line 6 End Sub

The Postcode text box is corrupted. As well as containing the correct
data it also contains a bunch of trailing stuff from another field.

If I look at these values in a Watch window, I notice the following:

At Line 1 in the function the value of Me.txtPostCode.Text = "GL5 4RT"
At Line 1 in the function the value of pcolAddress(5).ToString = "GL5
4RT"
At Line 6 in the function the value of Me.txtPostCode.Text = "GL5 4RT

NOTE THE MISSING " AT THE END.

The text box then displays:


Does that occur in a Windows Forms application? Maybe the string
contains a null character?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
hi***************@gmx.at (Herfried K. Wagner [MVP]) wrote in message news:<uL**************@TK2MSFTNGP09.phx.gbl>...
* te********@hotmail.com (Edward) scripsit: [...] Does that occur in a Windows Forms application? Maybe the string
contains a null character?


No, it's an ASPX app.

You're quite right, of course. The function to obtain the string from
the Address finder software returns a string with TWO null characters.
VB then decides that the second one is the string terminator. I've
written a routine to get the "real" string out and it works a treat.

Thanks

Edward
--
The reading group's reading group:
http://www.bookgroup.org.uk
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
4
by: erika | last post by:
I am trying to run the following update query in code. UPDATE TableTest SET STATUS = "A" WHERE (Code <> "X") AND (Code <> "J") ORDER BY DOB; I am getting an error, "Missing Semicolon (;) at...
2
by: sparks | last post by:
ok I was trying to do something real simple I thought Me.Clinic.DefaultValue = Me.Clinic.Value I got error either ! or . misused or not found...something like that I thought ok how can you not...
8
by: Ahmad A. Rahman | last post by:
Hi all, I have a problem constructing a regular expression using .net. I have a string, separated with comma, and I want to group the string together but, I failed to group a numeric character...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
8
sammyboy78
by: sammyboy78 | last post by:
I'm trying to create a class "WeeklyPay" that contains the methods that class "WeeklyPayTest" will use to compute the weekly pay of an employee when the user inputs employee name, hours worked, and...
23
by: dkirkdrei | last post by:
I am having a bit of trouble trying to double up on slashes in a file path. What I am trying to do is very similar to the code below: <? $var =...
10
by: ALKASER266 | last post by:
Hey guyz I have a prac and I am beginner and I did this code> Is my code is complete and if is it not complete how i can complete it? and how i can arrange it more? How I can make my driver to...
12
by: slizorn | last post by:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int err how do i fix that error? for example given to this section of code.. Matrix::addMatrix(Matrix m1,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.