473,835 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Missing double quote after string - HELP!

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

Private Sub cbfSetUpAddress es(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(pcolAddres s(5).ToString)
Me.txtPostCode. Text = strTemp.ToStrin g

but it made no difference.

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

TIA

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

Private Sub cbfSetUpAddress es(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******* *******@TK2MSFT NGP09.phx.gbl>. ..
* te********@hotm ail.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
2477
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" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
4
4241
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 end of SQL statement". Please tell me what is wrong with the syntax. It worked in Access 97. But in Access 2003, it is so fussy! I appreciate your help. Thanks, Erika
2
1727
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 find the variable that this field is tied to. ok it takes a variant so maybe its Me.Clinic.DefaultValue = Me..Value no thats not it so I just tried everything then someone said no do
8
3395
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 with decimal values. Example string : 1, 2.3, "two"," three" So, I want to group this string into 4 groups (1), (2.3), (two) and (three)
17
3040
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). I have a dataset as follows (1 week to keep it short): Employee 1 - Date 1 Employee 1 - Date 2
8
1865
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 pay rate. I get an error when trying to compile WeeklyPay.java: WeeklyPay.java:78: missing return statement }//end displayPay ^ Also if anyone sees anything else that's going to give me a problem please tell me about it....
23
13548
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 = "\\wusais\Intranets\Intranets\fpdb\pdf\weinig\00505882.pdf"; $new = preg_replace("\\", "\\\", "$var"); ?> Code above produces the following error:
10
1896
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 an array that generates an array of 20 students instead of my way of driver to enter it manually? THANK YOU VERY MUCH I will put the question then I will put my answer It is two codes one is Student which is the main one and the other one is...
12
39197
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, Matrix m3) { for(int a = 0; a < row; a++) { for(int b = 0; b < col; b++)
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9653
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6968
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3997
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.