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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Update command and FORM fields?

Status
Not open for further replies.

Hamrick

Technical User
Aug 13, 2001
2
US

Help!

I also need help with the Update command. I have created a FORM,
let's say it has several fields: field1, field2, field3, etc...

I want to issue an update to the database, using ALL the field values as
the input for the SQL update command... example:

UPDATE MyReport
SET Information = '::field1::' + '::field2::' + '::field3'
WHERE Member = 'john'

Here is the Problem! - I run out of room in the "SET" information row
and I need to append the information on a second line? Example:

UPDATE MyReport
SET Information = '::field1::' + '::field2::',
+ '::field3' + '::field4::' + '::field5::'
WHERE Member = 'john'

I get an errorrrrrrrrrrrrrrrrrrrrrrr! - Please HELP!!!!!!
 
The only way that I have found to correct this problem is to set another variable to the string and then reference the variables when you want your sql statement. For some reason I cannot get Access to recognize it when you split a statment into two lines, even when you use the line continuation character (_). Don't forget to include a space at the end of the first line or beginning of the second if need be. An example is below.
Code:
SQLText1 = "As much as can fit on one line"
SQLText2 = "The rest or as much as can fit on one line"

rst = SQLText1 & SQLText2
The hardest questions always have the easiest answers.
 
this should work (it never hasn't for me):

sqltext1 = "As much as you can fit on one line " & _
" as well as however much else text you need to add."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top