specifing fields to export

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to specify which fields I'd like to export to excel (for mail merge)
using check boxes in a form.
I.E when check box for surname is ticked, surname is exported. If not
selected the surname field is hidden.

Any help please
 
What you describe sounds very much like the query design window. Are you
looking to reinvent a way to select certain fields from one/more tables?

Regards

Jeff Boyce
<Access MVP>
 
Hi,


Write the string of the query, dynamically, with some VBA code, such as:


str="SELECT " & iif( check1, "field1,", null) & iif( check2,
"field2,", null) & ... "

' remove the ending coma,
mid(str, len(str), 1) = " "

'complete the statement
str=str & " FROM myTable"



Additionnal verification should be done, such as to be sure at least one
field is "checked", etc.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top