G
Guy Kerr
This sounded like something that wouldn't be too challenging but for some
reason I can't figure out the best way to do this.
I have an unbound form that contains Listboxes, radio buttons, unbound
controls, checkboxes etc. that correspond to fields in my database. This
form is designed to build a query - or at least the WHERE CLAUSE. Once the
user checks the boxes, fills in the unbound controls they click a button to
generate a query. For example if the user fills in Kerr* in LastName field,
checks off the >18 checkbox, select 'CA' from the State listbox then clicks
the GENERATE QUERY button a record is created in a table that is essentially
the Select Statement based on what the user selected on the form. So the
text generated would be "Lastname like '%Kerr' and Age > 18 and State = 'CA'".
Then when a user opens a form it does a DLookup based on the user name to
search the table for the latest query to correspond to that user. It then
uses this to apply the ServerFilter to the form which limits the dataset to
what the defined query is. This is not relevant to what I'm trying to
accomplish, I just wanted to explain the function of the form and the table
storing the queries.
What I WANT to do is export data to TAB Delim or CSV from the same table
based on any of the queries stored in this table. I was looking at
DoCmd.TransferText but it looked to me that you had to refer to a named
query. I was also considering using a report then export from that. This
way the user can see the data before choosing to Export.
If anyone has any ideas on how best to do this I would be very much
appreciative.
Guy
reason I can't figure out the best way to do this.
I have an unbound form that contains Listboxes, radio buttons, unbound
controls, checkboxes etc. that correspond to fields in my database. This
form is designed to build a query - or at least the WHERE CLAUSE. Once the
user checks the boxes, fills in the unbound controls they click a button to
generate a query. For example if the user fills in Kerr* in LastName field,
checks off the >18 checkbox, select 'CA' from the State listbox then clicks
the GENERATE QUERY button a record is created in a table that is essentially
the Select Statement based on what the user selected on the form. So the
text generated would be "Lastname like '%Kerr' and Age > 18 and State = 'CA'".
Then when a user opens a form it does a DLookup based on the user name to
search the table for the latest query to correspond to that user. It then
uses this to apply the ServerFilter to the form which limits the dataset to
what the defined query is. This is not relevant to what I'm trying to
accomplish, I just wanted to explain the function of the form and the table
storing the queries.
What I WANT to do is export data to TAB Delim or CSV from the same table
based on any of the queries stored in this table. I was looking at
DoCmd.TransferText but it looked to me that you had to refer to a named
query. I was also considering using a report then export from that. This
way the user can see the data before choosing to Export.
If anyone has any ideas on how best to do this I would be very much
appreciative.
Guy