n00b question

...

I fund the following code on the net but didn't work... says the update expression is missing a parameter

Dim dbs As Database
Dim qdf As QueryDef

Set dbs = CurrentDb
dbs.Execute "UPDATE alarm" & "SET 'field name' = True " & "WHERE 'field name' = false"

dbs.Close

can anyone see something wrong ?
thx
 
Create a string variable and put the Update query string into it. Then run the Sql using Docmd.Runsql
Also, don't make things so difficult. If you simply want all of the values to change to True, then change them all to True.


Code:
Dim sqlStr as String

sqlStr = "UPDATE TableName SET TableName.BooleanFieldName = True;"

DoCmd.RunSQL sqlStr
 
If BooleanFieldName is in more than 1 word, do i use brackets ??
" or ' ?
 
Two part answer:

1. Why did you name your field w/ two names???

2. Yes, use brackets (to answer your original question)
 
I'm not the one who names the field... its a big project.. i just took it over
 
Bummer deal..

Did the update query work?
 

Users who are viewing this thread

Back
Top Bottom