So here is what i want to do
I have a report created by two tables no problem so far
i what the user to be able to select the columns that he wants to export and also filter them
what i have done so far is that i created check buttons and each check button contains on part of the sql statement then i connect all of then and i have the ecxel that i want
for example
If Me.Check1 = True Then
sql1 = "Titles.ItemID as ItemID,"
Else: sql1 = ""
End If
...
sqlsum = "select " + sql1
sqlrest = " FROM Titl.Iteme = P_Item.ang_Id;"
sqltotal = sqlsum + sqlrest
strQry = "TempQueryName"
Set db = CurrentDb
Set Qdf = db.CreateQueryDef(strQry, sqltotal)
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, _
strQry, "C:\ads\asd.xls", True
DoCmd.DeleteObject acQuery, strQry
but that will not give me the fitering that i want
any suggestions ?
I have a report created by two tables no problem so far
i what the user to be able to select the columns that he wants to export and also filter them
what i have done so far is that i created check buttons and each check button contains on part of the sql statement then i connect all of then and i have the ecxel that i want
for example
If Me.Check1 = True Then
sql1 = "Titles.ItemID as ItemID,"
Else: sql1 = ""
End If
...
sqlsum = "select " + sql1
sqlrest = " FROM Titl.Iteme = P_Item.ang_Id;"
sqltotal = sqlsum + sqlrest
strQry = "TempQueryName"
Set db = CurrentDb
Set Qdf = db.CreateQueryDef(strQry, sqltotal)
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, _
strQry, "C:\ads\asd.xls", True
DoCmd.DeleteObject acQuery, strQry
but that will not give me the fitering that i want
any suggestions ?