>I have a button bar class with properties that hold the names of the aliases used for the form and its grid. The method for adding records has some code which uses INSERT - SQL. Since it's a class, the alias names can't be hard-coded, of course. They need to come from the class property, which is filled in the instance of the form. I'm trying various ways to use macro or name substitution, but I can't get the syntax right. My latest attempt goes like this:
>
>cAlias1 = THIS.Parent.Alias1;
> +'('+THIS.Parent.FieldName1;
>+','+THIS.Parent.FieldName2+')'
>INSERT INTO &cAlias1. VALUES(var1,var2)
>
>I also tried INSERT INTO (cAlias1) VALUES(var1,var2) and I still get syntax errors.
Build the entire query into a string like:
thequery = "INSERT INTO " + calias + ... blah blah blah
and then issue the query with macro subs:
&thequery
Erik Moore
Clientelligence