Hey All!
I have a rather strange one that I’m working on. Can a query be modified in code? Now I don’t mean create the whole query, or work with the SQL. What I’m trying to do is similar to the way you can append fields to a table and then modify their properties. Here is the example from Access 97’s help:
Sub NewField()
Dim dbs As Database, tdf As TableDef
Dim fld As Field
‘ Return reference to current database.
Set dbs = CurrentDb
‘ Return reference to Employees table.
Set tdf = dbs.TableDefs!Employees
‘ Create new Field object.
Set fld = tdf.CreateField(“SSN#”)
‘ Set Type and Size properties of Field object.
fld.Type = dbText
fld.Size = 11
‘ Append field.
tdf.Fields.Append fld
Set dbs = Nothing
End Sub
What I’d like to do is exactly this, but except for a table, do it for a query. But not just a query, an Append query. So I need to be able to add the “field” to the design grid, then set its properties (ie. Append To, etc).
Has anyone done anything like this successfully? In the mood for a challenge?
TIA!
Cecilia
I can do it, but unsuccessfully *g*