From: Jim on
anyone know how to run an append (well any query I suppose) from code.

I'm rusty and actually have never ran a query from code.

I'm thinking docmd.runquery("query")

TIA


From: Tom van Stiphout on
On Fri, 04 Jul 2008 03:26:48 GMT, "Jim" <jimt(a)pioneers.ca> wrote:

Not "any query", but "any action query":
DoCmd.RunSQL

The help file would have told you runquery is not a legal action.
Don't use the newsgroups in lieu of the help file.

-Tom.


>anyone know how to run an append (well any query I suppose) from code.
>
>I'm rusty and actually have never ran a query from code.
>
>I'm thinking docmd.runquery("query")
>
>TIA
>
From: Jim on
Hey dude hold your fire.

I'm not a code genius. I've been trying to find it myself in help and on the
access web. I don't want to run SQL per se, I already have an append query
created and just want to run it - simplifying things for myself, so I don't
get caught up in code.

Is this not an access (all access, not just code and SQL) newsgroup?




"Tom van Stiphout" <no.spam.tom7744(a)cox.net> wrote in message
news:m86r64l54gfujv5s5o4u47kle40tcse77i(a)4ax.com...
> On Fri, 04 Jul 2008 03:26:48 GMT, "Jim" <jimt(a)pioneers.ca> wrote:
>
> Not "any query", but "any action query":
> DoCmd.RunSQL
>
> The help file would have told you runquery is not a legal action.
> Don't use the newsgroups in lieu of the help file.
>
> -Tom.
>
>
>>anyone know how to run an append (well any query I suppose) from code.
>>
>>I'm rusty and actually have never ran a query from code.
>>
>>I'm thinking docmd.runquery("query")
>>
>>TIA
>>


From: fredg on
On Fri, 04 Jul 2008 03:41:36 GMT, Jim wrote:

> Hey dude hold your fire.
>
> I'm not a code genius. I've been trying to find it myself in help and on the
> access web. I don't want to run SQL per se, I already have an append query
> created and just want to run it - simplifying things for myself, so I don't
> get caught up in code.
>
> Is this not an access (all access, not just code and SQL) newsgroup?
>
> "Tom van Stiphout" <no.spam.tom7744(a)cox.net> wrote in message
> news:m86r64l54gfujv5s5o4u47kle40tcse77i(a)4ax.com...
>> On Fri, 04 Jul 2008 03:26:48 GMT, "Jim" <jimt(a)pioneers.ca> wrote:
>>
>> Not "any query", but "any action query":
>> DoCmd.RunSQL
>>
>> The help file would have told you runquery is not a legal action.
>> Don't use the newsgroups in lieu of the help file.
>>
>> -Tom.
>>
>>
>>>anyone know how to run an append (well any query I suppose) from code.
>>>
>>>I'm rusty and actually have never ran a query from code.
>>>
>>>I'm thinking docmd.runquery("query")
>>>
>>>TIA
>>>

The help files in Access are split into different sections.
There is an Access help and a VBA help.
Since you are dealing with code you need to look in the Code (VBA help
) section.
Open any code window (or click Ctrl+G) and then click on help.
Or you can use the Command Button wizard to add a command button to a
form. One of the choices is to run a Query. Let it create the code,
then examine what the wizard wrote.

You can use the
DoCmd.OpenQuery "QueryName"
method...
Or
CurrentDb.Execute "QueryName"

Look them up in VBA help.
While there, also look up SetWarnings as well.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail