> Doctor wrote:
> >I continue to get an "invalid SQL error" with the following SQL. When I copy
> >the sql from the immediate window into a query, it runs fine.
> >
> >Here is the code generating the sql statment.
> >
> > 'Create Link in tblLLCRegLink
> > If Not IsNothing(strGroupID) Then
> > Me.LLCRegGroupID.Requery
> > Me.LLCRegGroupID.Value = strGroupID
> > strSQLa = "INSERT tblLLCRegLink ( LLCRegGroupID, LLCRegID ) " & _
> > "SELECT " & strGroupID & " AS Expr1, " & strGroup & " AS Expr2 ;"
> > Debug.Print strSQLa
> > DoCmd.SetWarnings False
> > DoCmd.RunSQL strSQL2
> > DoCmd.SetWarnings True
> > Me.sfrmLLCRegLink.Requery
> >
> >Here is a sample SQL statement generated in the Immediate window.
> >
> >INSERT INTO tblLLCRegLink ( LLCRegGroupID, LLCRegID ) SELECT 9 AS Expr1, 281
> >AS Expr2 ;
> >
> >I'm not sure what to do. Any help would be tremendously appreciated.
> >
> >Thanks.
> >
> >And may I say, I love this site! Constantly find help here (even if I only
> >post once a month or so) Kudos to those of you who are willing to help those
> >like me.
>
>
> You have the DoCmd.RunSQL set to strSQL2 and you are building a strSQLa
>
> --
> James B Gaylord
> For the Wolf comes the strength of the Pack,
> For the Pack comes the strength of the Wolf,
> -R. Kipling
> Office 2003 on Win XP SP2
>
> Message posted via AccessMonster.com
>
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200811/1>
>