you know, you might need to create the query through code with this kind of complexity. something like:
Code:
button on_click()
on error resume next
currentdb.querydefs.delete "myquery"
dim qry as dao.querydef
dim activeaccts as boolean
dim sql as string
dim temp as string
dim i as integer
temp = ""
if me.activeaccountsCbox = -1 then
activeaccts = true
end if
for i = 0 to me.ListBoxFields.listcount - 1
if me.listboxfields.column(0, i).selected then
temp = temp & me.listboxfields.column(0,i) & ","
end if
next i
temp = iif(temp = "", "", left(temp, len(temp) - 1))
sql = "SELECT "
sql = sql & iif(temp = "", "* ", temp) & " "
sql = sql & "FROM table "
sql = sql & iif(activeaccts = true, "WHERE [activeaccounts] = -1", "")
sql = trim(sql)
currentdb.createquerydef("myquery", sql)
refreshdatabasewindow
docmd.openreport "myreport", acViewPreview
that returns all records if no fields are selected. If the report is based on that query, it can be dynamic with code similar to that.