On Nov 7, 10:32 pm, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
If TrialFerts is the recordsource for the subform, there's no reason to use
OpenQuery on it. Simply remove that line of code.
Assuming that AppendTrialFerts and AppendBasalFerts are action queries
(Append, Delete, Update or Make Table), OpenQuery isn't a great way to run
them. Instead, use:
CurrentDb.QueryDefs("AppendTrialFerts").Execute dbFailOnError
CurrentDb.QueryDefs("AppendBasalFerts").Execute dbFailOnError
That has the advantage of not popping up the message saying "n records are
going to be append, do you want to continue?", plus will generate a
trappable error if something goes wrong running the query.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> DoCmd.SetWarnings False
> DoCmd.OpenQuery "AppendTrialFerts"
[quoted text clipped - 9 lines]
> a separate window. I would like only for the query to open in the
> subform but not in the separate query window.
c8tz - 12 Nov 2007 04:02 GMT
On Nov 8, 9:56 pm, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
> If TrialFerts is the recordsource for the subform, there's no reason to use
> OpenQuery on it. Simply remove that line of code.
[quoted text clipped - 29 lines]
>
> - Show quoted text -
thanks for your help...... i initially thought the openquery was
needed to actually run the query.. it works fine now.
with the append queries i used docmd.show warnings false and
then ..... warnings true at the end.
thanks heaps again.