Re: Updating a field in a record stored in a table

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



ndunwoodie wrote:
> I'm sorry to report that I did have a field name misspelled. Now my
> problem is that the code doesn't do any updating at all. My field,
> txtMBusDetention, in the table is just as empty after running the
> code as before(it is spelled correctly). It is supposed to have a 1
> in it.

And you get no errors? Is that field a number or text DataType? If it's
text you need to put quotes around the 1. Since the SQL string is already
inside double-quotes you have to use single quotes to avoid a conflict.

strSQL = "UPDATE students " & _
"SET txtMBusDetention = '1' " & _
"WHERE txtStudent = '" & Forms!frmMissBus!cboName & "'"
CurrentDb.Execute strSQL, dbFailOnError

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.



Relevant Pages

  • Re: Opening a Report to a Specific Record
    ... I think you are missing some single quotes around in the double quote. ... The report is based on a query that shows ... DoCmd.OpenReport "rptBuildingPermit", acViewPreview,, strWhere ... As far as the records being in random order, ...
    (microsoft.public.access.reports)
  • Re: Updating a field in a record stored in a table
    ... the SET statement. ... "Rick Brandt" wrote: ... > ndunwoodie wrote: ... > inside double-quotes you have to use single quotes to avoid a conflict. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Help Pls - 1 Combo box and 1 Date Field on a form to create a repo
    ... enclose the value in single quotes within the double quotes, ... I have the combo box on a form with a "Run Report" command button - the ... Combo Box is pulling from a "Team Leads" Table that houses all the Team ... Date field name is "Monitor Date" ...
    (microsoft.public.access.reports)
  • Re: cmd button to open report
    ... >> Herman, ... >> been saved, you must explicitly save it before running the report, ... >> I do not reply to personal email. ... Notice the name Herman is surrounded by single quotes. ...
    (microsoft.public.access.forms)
  • Re: [PHP] Back to Basics - Why Use Single Quotes?
    ... convention. ... Even updating existing code. ... And I broke some stuff that was doing variable expansion. ... is there any reason to use single quotes? ...
    (php.general)