473,513 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can someone tell me what I am missing with strings

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.[Clinic].Value

no thats not it so I just tried everything then someone said no do
this

Me.Clinic.DefaultValue = CStr("""" & Me.Clinic.Value & """")

well this works but what I can NOT get thru my head is why doe you
have to have 4 " ???

explaining it to me won't work...where can I go read about these types
of things so I can get them thru my thick head?

its like a thing I did once for school it was getting data into a
database from a web page

simple=====

string sCommand = "INSERT INTO tblAgreement(ContractNumber, ExpDate,
Status, Allowed) VALUES (" + ContractNumber +",'" + ExpDate + "','" +
Status.ToString() + "'," + Allowed.ToString() + ");"

but it took me 2 days to get it right....AHHHHHHHH I can't get these
parsers and stuff

thanks for any help

Jerry

Nov 13 '05 #1
2 1713
sparks wrote:
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.[Clinic].Value

no thats not it so I just tried everything then someone said no do
this

Me.Clinic.DefaultValue = CStr("""" & Me.Clinic.Value & """")

well this works but what I can NOT get thru my head is why doe you
have to have 4 " ???
From A97 Help topic "Quotation Marks In Strings"
Include Double Quotation Marks

You should include double quotation marks within the criteria argument
in such a way so that when the value of the variable is evaluated, it
will be enclosed within the quotation marks. Within a string, you must
use two sets of double quotation marks to represent a single set of
double quotation marks. You could construct the criteria argument as in
the following example:

"[LastName] = """ & strName & """"

When the variable strName is evaluated and concatenated into the
criteria argument, each set of two double quotation marks is replaced by
one single quotation mark. The criteria argument becomes:

"[LastName] = 'Smith'"

*******
Note: The above is an error in MS Help. Access does not change double
quotes into single quotes. It would be "[LastName] = "Smith""
*******

This syntax may appear more complicated than the single quotation mark
syntax, but it enables you to embed a string that contains an apostrophe
within the criteria argument. It also enables you to nest one or more
strings within the embedded string.

Include a Variable Representing Quotation Marks

You can create a string variable that represents double quotation marks,
and concatenate this variable into the criteria argument along with the
value of the variable. The ANSI representation for double quotation
marks is Chr$(34); you could assign this value to a string variable
called strQuote. You could then construct the criteria argument as in
the following example:

"[LastName] = " & strQuote & strName & strQuote

When the variables are evaluated and concatenated into the criteria
argument, the criteria argument becomes:

"[LastName] = "Smith""
explaining it to me won't work...where can I go read about these types
of things so I can get them thru my thick head?

its like a thing I did once for school it was getting data into a
database from a web page

simple=====

string sCommand = "INSERT INTO tblAgreement(ContractNumber, ExpDate,
Status, Allowed) VALUES (" + ContractNumber +",'" + ExpDate + "','" +
Status.ToString() + "'," + Allowed.ToString() + ");"

but it took me 2 days to get it right....AHHHHHHHH I can't get these
parsers and stuff

But didn't you feel better when you got it working?


thanks for any help

Jerry

Nov 13 '05 #2
I guess its what I am seeing here
CStr("""" & Me.Clinic.Value & """")

this looks to me like it should be """ & Me.Clinic.Value & """
why the extra "

if you have to put the " in quotes why do you have to put 2 sets of
quotes?

Jerry

On Wed, 31 Aug 2005 14:17:15 GMT, Salad <oi*@vinegar.com> wrote:
sparks wrote:
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.[Clinic].Value

no thats not it so I just tried everything then someone said no do
this

Me.Clinic.DefaultValue = CStr("""" & Me.Clinic.Value & """")

well this works but what I can NOT get thru my head is why doe you
have to have 4 " ???


From A97 Help topic "Quotation Marks In Strings"
Include Double Quotation Marks

You should include double quotation marks within the criteria argument
in such a way so that when the value of the variable is evaluated, it
will be enclosed within the quotation marks. Within a string, you must
use two sets of double quotation marks to represent a single set of
double quotation marks. You could construct the criteria argument as in
the following example:

"[LastName] = """ & strName & """"

When the variable strName is evaluated and concatenated into the
criteria argument, each set of two double quotation marks is replaced by
one single quotation mark. The criteria argument becomes:

"[LastName] = 'Smith'"

*******
Note: The above is an error in MS Help. Access does not change double
quotes into single quotes. It would be "[LastName] = "Smith""
*******

This syntax may appear more complicated than the single quotation mark
syntax, but it enables you to embed a string that contains an apostrophe
within the criteria argument. It also enables you to nest one or more
strings within the embedded string.

Include a Variable Representing Quotation Marks

You can create a string variable that represents double quotation marks,
and concatenate this variable into the criteria argument along with the
value of the variable. The ANSI representation for double quotation
marks is Chr$(34); you could assign this value to a string variable
called strQuote. You could then construct the criteria argument as in
the following example:

"[LastName] = " & strQuote & strName & strQuote

When the variables are evaluated and concatenated into the criteria
argument, the criteria argument becomes:

"[LastName] = "Smith""

explaining it to me won't work...where can I go read about these types
of things so I can get them thru my thick head?

its like a thing I did once for school it was getting data into a
database from a web page

simple=====

string sCommand = "INSERT INTO tblAgreement(ContractNumber, ExpDate,
Status, Allowed) VALUES (" + ContractNumber +",'" + ExpDate + "','" +
Status.ToString() + "'," + Allowed.ToString() + ");"

but it took me 2 days to get it right....AHHHHHHHH I can't get these
parsers and stuff


But didn't you feel better when you got it working?


thanks for any help

Jerry


Nov 13 '05 #3

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

Similar topics

11
1894
by: milkyway | last post by:
Hello, I have an HTML page that I am trying to import 2 .js file (I created) into. These files are: row_functions.js and data_check_functions.js. Whenever I bring the contents of the files into...
5
1545
by: greenflame | last post by:
How can I tell if a variable. I want ot tell whether two variables are: 1. Both numbers. Just a number. same as the number object in javascript. 2. Either one is a string containing a number....
6
1654
by: Helmut Giese | last post by:
Hello out there, I am a rather experienced C programmer. However, today I got a javascript assignment because someone left (something like: "You're a great programmer - you'll handle this.") and I...
6
1317
by: MLH | last post by:
If I cut it from the rest of the SQL, the query runs fine. But when I leave the following WHERE clause in there, Access tells me there's a missing Operator? WHERE (((tblVehicleJobs.SerialNum)...
15
2599
by: Walter Dnes (delete the 'z' to get my real address | last post by:
I'm trying to initialize an array of error messages, so that I can print out an error message by using the 'nth string in an array, e.g. printf("%s\n", messages); I'm still hazy on arrays of...
1
1243
by: Henry Stock | last post by:
I was just looking that the Word Document Model and at code for creating a Word Document. The C# code appears to have several more parameters for creating a Word Document than does Visual Basic. ...
1
1615
by: jazzMan007 | last post by:
Hi All - I'm using the new UrlMappings feature in an ASP.NET 2.0 application. I'm using the unique urls, mapped to shared files, in the site map. So for example, I have pages A, B, & C...all of...
4
1981
by: Jan | last post by:
This is my problem: When i have more than 3 lines of text in de tempArray. Iget the following message: An unhandled exception of type 'System.NullReferenceException' occurred in Allen's...
2
1223
by: William Morgan | last post by:
Public Declare Sub ydec_set_callback Lib "yDecLib.dll" (ByVal CallbackFunc As Long) Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal lpvDest As String, ByVal lpvSource As...
0
7265
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,...
0
7171
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...
0
7388
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,...
0
7545
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5095
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...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
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.