Using a querydef object eliminates the need for turning warnings off/on. You might miss an unrelated but important warning, in the meantime.
Try this ... Dim qdf As DAO.QueryDef Set qdf = CurrentDb.QueryDefs("Qry_Prescreen_Commissions_Make_Tbl") qdf.Execute dbFailOnError Set qdf = Nothing Works great for any action query, and you can also assign parameter values. HTH Bryant --- In AccessDevelopers@yahoogroups.com, "George Oro" <[EMAIL PROTECTED]> wrote: > > Try this: > > DoCmd.SetWarnings False 'Turn-off the warning msg > DoCmd.OpenQuery "Qry_Prescreen_Commissions_Make_Tbl", acViewNormal, > acEdit > DoCmd.SetWarnings True 'Turn-on the warning msg > > HTH > > > > -----Original Message----- > From: AccessDevelopers@yahoogroups.com > [mailto:[EMAIL PROTECTED] Behalf Of torres0157 > Sent: Friday, October 14, 2005 7:24 PM > To: AccessDevelopers@yahoogroups.com > Subject: [AccessDevelopers] Macro question: > > > I have a form that gets its objects from a query. The form is opened > when the user click on a button 'Commission' and an event procedure is > executed Docmd.OpenForm. The problem I am having is that I also need a > a make table query executed before the form is Opened. I tried this > code but it was incorrect. Can someone Help... > > stDocName = "Prescreen_Commission_Form" > DoCmd.OpenQuery Qry_Prescreen_Commissions_Make_Tbl > DoCmd.OpenForm stDocName, , , stLinkCriteria > > Thanks, > A.T. > > > > > > > > > > Please zip all files prior to uploading to Files section. > Yahoo! Groups Links > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/