Try this:
1. Create a Parameter query on the SourceTable with the Parameter on the
Source field
2. Create a user form with a combobox where the RowSource is a SELECT
DISTINCT query of all the unique values for Source from the SourceTable
3. Add a button to the form, with OnClick event code which runs a make table
query based on the value selected in the combobox:
SELECT SourceTable.Email INTO tblNew
FROM SourceTable
WHERE (((SourceTable.Source)=[Forms]![frmUser].[cmbSelectSource]));
You can construct the query in code as follows to name the new table
according to the Source:
Dim strSQL as String
Dim strSourceSelected as String
strSourceSelected = Trim$(Me!cmbSource.Value)
strSQL = "SELECT SourceTable.Email INTO tbl_" & strSourceSelected & "_ " &
Now()
strSQL = strSQL & " FROM SourceTable"
strSQL = strSQL & " WHERE
(((SourceTable.Source)=[Forms]![frmUser].[cmbSelectSource]));"
DoCmd.RunSQL strSQL
--
Tony D'Ambra
Web Site: aadconsulting.com
Web Blog: accessextra.net
"Chris via AccessMonster.com" <fo***@AccessMonster.com> wrote in message
news:1d******************************@AccessMonste r.com...
I have the challenge of needing to automate table creation. It doesn't end
there the tables have to be created from one table that looks something
like this...
Email Source
at@at.com EB
no@no.com EN
in@in.com EB
at@at.com EN
I have to create those tables based on grouped records in the Source
field. So in this case i would need a table EB and another EN. Problem is
that this week it is EN and EB and next week they could be MN and MB so
that is variable and it needs to be the table name. I need to automate
this task in either Access; Access VB: or SQL as those are the only tools
available. Any assistance is appreciated.
--
Message posted via http://www.accessmonster.com