Re: UPDATE Not UpDating

Tech-Archive recommends: Fix windows errors by optimizing your registry



Is TableNumber numeric, or are you storing a number in a text field?

If it's text, you need quotes around the value:

CurrentDb.Execute "UPDATE Tables SET TInUse = True WHERE TableNumber = " &
Chr$(34) & Me.TM & Chr$(34)

If that's not the problem, make sure you didn't misspell any of the field
names, and that Me.TM actually has the value you expect it does.

You can try

Dim strSQL As String

strSQL = "UPDATE Tables SET TInUse = True WHERE TableNumber = " &
Chr$(34) & Me.TM & Chr$(34)
Debug.Print strSQL
CurrentDb.Execute strSQL, dbFailOnError

Look at what's printed for strSQL: does it make sense?


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"DS" <bootybox@xxxxxxxxxxxxx> wrote in message
news:A7i1f.751$Hm3.56@xxxxxxxxxxx
> Douglas J. Steele wrote:
>
>> Get rid of the commas.
>>
>> As well, you need to put the reference to Me.Tm outside of the quotes:
>>
>> CurrentDb.Execute "UPDATE Tables SET TInUse = True WHERE TableNumber = "
>> & Me.TM
>>
>>
>
> I get Error code 3601, to few parameters -1 expected......
> What could it be?
> Thanks
> DS


.



Relevant Pages

  • Re: VB INSERT INTO
    ... I can't see any way that that error message is related to the one line of ... Doug Steele, Microsoft Access MVP ... Debug.Print strSQL ... Numeric value shouldn't have quotes around them, so if, for example, ...
    (microsoft.public.access.modulesdaovba)
  • Re: VB INSERT INTO
    ... Debug.Print strSQL ... Doug Steele, Microsoft Access MVP ... Numeric value shouldn't have quotes around them, so if, for example, ... Set conDatabase = CurrentProject.Connection ...
    (microsoft.public.access.modulesdaovba)
  • Re: Need VBA Help to Append!
    ... here then your process of building the strSQL is still faulty. ... select start with opening Quotes or single quotes or # ALL wrong). ... You don't seem to understand how to concatenate a long string. ... strSQL = "INSERT INTO tblAttendanceRecords(EmployeeID, EmployeeName, ...
    (microsoft.public.access.formscoding)
  • Re: Need VBA Help to Append!
    ... strSQL = "INSERT INTO tblAttendanceRecords (EmployeeID, ... tblAttendanceRecords (EmployeeID (space before parentheses) ... select start with opening Quotes or single quotes or # ALL wrong). ... You don't seem to understand how to concatenate a long string. ...
    (microsoft.public.access.formscoding)
  • Limiting list in a form
    ... Dim strSQL As String ... FROM [LoanOfficer] Where ... additional Dim statement to call an object on the form, ... >Change just those double quotes to single quotes. ...
    (microsoft.public.access.forms)