> You're welcome. Good luck with it.
>
[quoted text clipped - 69 lines]
> >> > the
> >> > txtBox values into table...much thanks
Hi.
> hmmmm getting a syntax error
Actually, you have 10 errors, possibly more if the Date column is a Date data
type. New at this, huh? ;-)
It's hard to see the single quotes next to the double quotes, and the browser
wrapping the text lines around improperly doesn't help any. Before I get
started on fixing this, let me tell you some of the rules of building a text
string in code, and let me ask you a question as well.
One cannot use Date, or any other Reserved word, as an identifier (table name,
column name, object name, procedure name, et cetera), because it will introduce
bugs into the program. So change the column name Date to something like
ShipDate. Is this column a date data type or a text string? The syntax I give
you depends on your answer.
When building a string, you're concatenating strings together, so you must place
a space, an ampersand, and another space between each text string (begins and
ends with double quotes) or variable. For example, if the text box control
TableName has CarLot and the text box control NumCars has 72, then you can use:
sSQL = "UPDATE " & Me!TableName.Value & " SET NumCars = " & Me!NumCars.Value
This will place the string, "UPDATE CarLot SET NumCars = 72" into the variable
sSQL. Notice that there's also a space after UPDATE and before the TableName
value, because we don't want manywordsrunningtogether after concatenation
because the computer can't parse the tokens (words) in the string out of the
mess.
Please reply back with the data types of each of your columns that will be used
in the SQL statement.
Oh, in case you're interested, your code produced this text string:
"UPDATE QBTermsSET date = "
You may ask why QBTerms and SET are run together. It's because you told the
computer to concatenate the strings that way. The computer does exactly what
you tell it to do. You may also wonder why the string is cut off after the
space following the equals sign. The single quote (if it's not within a text
string) means "everything to the right of this mark is a comment." That's what
your single quote did, it commented out a
runtogetherAmpersandAndControlNameAndTheRest:
'&Me!Shipvia.Value&'""
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
> hmmmm getting a syntax error
>
[quoted text clipped - 92 lines]
>> >> > the
>> >> > txtBox values into table...much thanks
'69 Camaro - 29 Dec 2006 06:15 GMT
Try:
CurrentDb().Execute "UPDATE QBTerms SET [date] = '" & _
Me!Shipvia.Value & _
"' WHERE record = 4;", dbFailOnError
HTH.
Gunny
See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.
> Hi.
>
[quoted text clipped - 149 lines]
>>> >> > the
>>> >> > txtBox values into table...much thanks