If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL Problem!!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-17-04, 13:02
BrewCrew BrewCrew is offline
Registered User
 
Join Date: May 2004
Posts: 20
Question SQL Problem!!!

i'm having a problem with an access database that i'm trying to use SQL statements in. what i'm trying to do is update a table from information that is put onto a form but i can't bind the form to the table. the information needs to be put in the table so that another form can pull it up when needed. i tried using sql statements to pull this off, this is what i have:

strSQL = "Update KanbanCards SET NumberofCards =" & NumCards & " WHERE Item# =" & [Forms]![KanbanCards]![Item#] & ""

DoCmd****nSQL strSQL

however when i run my program and click on the command button that will eventually run this code, i get 2 input boxes asking for values and i just click okay through those and then i get an error saying "Syntax error in date in query expression 'Item# = 8912004'" where the item number is just a part number that i'm working with. i don't have a clue what the problem is. if anyone has a good idea on what to try or to do it would be greatly appreciated. thank you very much in advance.
Reply With Quote
  #2 (permalink)  
Old 05-17-04, 23:08
derrickleggett derrickleggett is offline
Registered User
 
Join Date: Apr 2004
Location: Kansas City, MO
Posts: 734
I don't suppose your Item# is a text field is it?
__________________
MeanOldDBA
derrickleggett@hotmail.com
When life gives you a lemon, fire the DBA.
Reply With Quote
  #3 (permalink)  
Old 05-18-04, 08:52
namliam namliam is offline
Registered User
 
Join Date: Jan 2004
Location: The Netherlands
Posts: 421
Which is why you shouldnt use !@#$%^&*()_ and "spaces" in field names !!!!


*Sigh* will we ever learn???

strSQL = "Update KanbanCards SET NumberofCards =" & NumCards & " WHERE [Item#] =" & [Forms]![KanbanCards]![Item#] & ""

Regards
Reply With Quote
  #4 (permalink)  
Old 05-18-04, 11:57
BrewCrew BrewCrew is offline
Registered User
 
Join Date: May 2004
Posts: 20
yes it is a text field actually, will that make a difference? i didn't write the original database so don't yell at me!!! i wondered if the fact that item# does have the # sign in it will cause the error but i read that # is a valid character to use to name variables.
Reply With Quote
  #5 (permalink)  
Old 05-18-04, 13:04
BrewCrew BrewCrew is offline
Registered User
 
Join Date: May 2004
Posts: 20
i did what you have right there and now i'm getting a data mismatch but my table has number for the data type of NumberofCards and i'm entering a 2 as the value.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On