Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic syntax help

Status
Not open for further replies.

Mary10k

IS-IT--Management
Nov 8, 2001
103
US
Hello,
I am trying to insert data from two fields, eventually more. Could you please tell me how I would code the two fields? I have the following for my insert statement and am not sure about the syntax before frmcontact.

When do you use double and single quotes?

sqlStatement = "INSERT INTO Meta_Data (Source,Contact) VALUES ('"& frmSource & "')" & "'" & ('"frmContact"')"

Thank you.
 
This should do it...

sqlStatement = " INSERT INTO Meta_Data(Source,Contact) VALUES ('"&frmSource&"', '"&frmContact&"') "

-L
 
Use double quotes to delimit strings in your code.

Use single quotes within the SQL statment itself.

Example:
Dim strSQL
strSQL = "SELECT * FROM MyTable WHERE (FirstName = 'Bob')"

 
You want your query look like this...

INSERT INTO Meta_Data(Source,Contact) VALUES ('value1', 'value2') "

where your value1="&frmSource&"

so in query it should be a single quote and when u r getting your form varibale it shud be a double quote...

-L
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top