Update problem

Brian Martin

Registered User.
Local time
Today, 19:31
Joined
Jul 24, 2002
Messages
68
Nothing is being updated What is wrong with this code?:
SQLstring = "UPDATE [Product List] SET [Full Description] =" & [Forms]![frmChoose]![subChoose].[Form].Controls![FD] & "WHERE [Part Number] =" & [Forms]![frmChoose]![subChoose].[Form].Controls![PN] & ";"
 
Put a space before the WHERE
 
Try:
Code:
SQLstring = "UPDATE [Product List] SET [Full Description] ='" & [Forms]![frmChoose]![subChoose].[Form].Controls![FD] & "' WHERE [Part Number] =" & [Forms]![frmChoose]![subChoose].[Form].Controls![PN] & ";"
I'm pretty sure you can also remove the .Controls reference since it's the default collection of the Form property like this:
Code:
SQLstring = "UPDATE [Product List] SET [Full Description] ='" & [Forms]![frmChoose]![subChoose].[Form]![FD] & "' WHERE [Part Number] =" & [Forms]![frmChoose]![subChoose].[Form]![PN] & ";"
I am assuming that [Full Description] is a text field and that [PN] is numeric.
 
Still stuck

Both fields are text fields.
i now have the following and it still doesn't work.

SQLstring = "UPDATE [Product List] SET [Full Description] =" & [Forms]![frmChoose]![subChoose].[Form].Controls![FD] & _
" WHERE [Part Number] = " & [Forms]![frmChoose]![subChoose].[Form].Controls![PN] & ";"

Any more thoughts?
 
Code:
SQLstring = "UPDATE [Product List] SET [Full Description] = """ & [Forms]![frmChoose]![subChoose].[Form].Controls![FD] & _
""" WHERE [Part Number] = """ & [Forms]![frmChoose]![subChoose].[Form].Controls![PN] & """;"
 
No luck

tried your code and it didn't work either. I'm stumped. the reason I'm trying to do this instead of a regular query is because I have a memo field that just wont allow anything greater than 255 characters and i read in this forum that some people solved this problem by doing their queries in code. I can't even add more than 255 when directly typing into the table. Any other ways of fixing this?
 
Why doesn't your query allow a memo field greater than 255?

but then if you can't type more than 255 directly into the table the field isn't defined as Memo
 
Getting there

It is a memo. I have partly sorted the problem. i had set the format of the memo field as > to make all the text capitals. i deleted that and now it lets me input more than 255. But when I run an append query I'm sometimes getting gobbldeegook added on to the end.
 
If you apply formatting to a memo field then the query will restrict the Memo output to 255
 

Users who are viewing this thread

Back
Top Bottom