Re: Update Query

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



Thank you for you help. I've taken another step up the learning curve with
you assistance.
--
Thank you,
Del


"Tim Ferguson" wrote:

> =?Utf-8?B?RGVs?= <Del@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
> news:E399EF6D-7CCA-4A4D-9BBB-DBF8B6547A18@xxxxxxxxxxxxx:
>
> > I was able to get the following code to do what I expected. Is there
> > any distinct advantage of the code Tim Ferguson suggested over the
> > RunSQL method?
> >
> > Private Sub Command0_Click()
> > DoCmd.RunSQL "UPDATE Table2 " & _
> > "Set Table2.One = 'XX' " & _
> > "Where Table2.Three = 'Test';"
> > End Sub
> >
>
> The execute method gives you more control: no user warning messages,
> trappable errors, longer command string (32K versus 256 chars, I think);
> in general doing stuff via VBA direct on the database is better than
> using the GUI (that's what DoCmd does) and hoping Access knows what you
> want.
>
> I guess you are using ADO rather than DAO -- that's why it didn't work
> with "double quotes" and did with "single quotes". In that case you need
> to use the .Execute method of the Connection or Command object. It's all
> documented in Help.
>
> HTH
>
>
> Tim F
>
>
.