I understand that there are issues. Unfortunately due to time constraints I
can not take care of those at the moment. I will though once the program is
operational. My boss has no concept of what it takes to create any program,
or the amount of time. He gave me 2 weeks to get it done. Its a week late
now. I value my job, and have come here to get help from you guys. Which you
have graciously provided. I am not though an expert like the rest of you. I
have read through help files by the hundreds, scoured the internet, and much
more to try and get this done. Once its up an running I can then create a
secondary copy to make the corrections to, and then import all data from the
db in use to the fixed one. I need to know what is wrong with this code:
sql = "UPDATE Month_End" & vbNewLine & "SET Month_End_Total = Text15.value"
& vbNewLine & "WHERE Month_End_Date =" & strValue & Format([Date], "mm/yyyy")
Debug.Print sql
CurrentDb.Execute (sql)
and why it gives me this error:
Run-time error '3075':
Syntax error (missing operator) in query expression 'Month_End_Date =o CDM
03/2006'.
I really do appreciate the help and advice. I have only been programming for
4 years, so my experience is very limited. Most entailing minor vb scripting
to access and excel. This is the first major program my boss has requested,
and I am trying to do the best I can. Given more time I could set everything
up more properly. Unfortunately I don't have that luxury. I am begging anyone
that can help me please tell me exactly what is wrong with the code, and what
it needs to be to work please.
C_Ascheman
Tim Ferguson said:
I still at a loss as to whats wrong with it. Month_End is a table in
my access db. Month_End_Total and Month_End_Date are fields within tha
table. Text15.value is a text box on my form, and o CDM 03/2006 is a
unique value that is generated by combining strValue and
format([Date],"mm/yyyy"). I need
You could read a little in the help files about passing values to the SQL
engine and delimiters. If you want something to end up looking like this:
WHERE Month_End_Date = "o CDM 03/2006"
(and you do...), then you need to insert the quote chars too:
jetSQL = jetSQL & vbNewLine & _
"""" & "o CDM 03/2006" & """"
Hope that helps
Of course, correcting the table design would help too.
Tim F