Connecting Tech Pros Worldwide Help | Site Map

Make Table Query Question

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:53 PM
JJ
Guest
 
Posts: n/a
Default Make Table Query Question

I have a Make Table query which uses a date parameter. Each time the
user runs the query they will be prompted for a date. The table which
is created should be named based on the date which they entered. For
example: The query will retieve all invoices dated xxxxx, the user
will may supply the date of Jan 1 2004. It should create a table
called "Jan 1 2004 Invoices" (or something like that). Each table
created needs to be saved in the database with an appropriate name.
How can I have the query create a table with a name based on the date
input?

  #2  
Old November 12th, 2005, 06:54 PM
Squirrel
Guest
 
Posts: n/a
Default Re: Make Table Query Question

I'd try it this way.
Offer the user a form with a textbox in which to enter the date.
The user enters e.g. 4/15/2003 and you could put an input mask on the
control to ensure
a valid date is entered.
Then he hits a command button and you could run code like this:

docmd.runsql "SELECT InvoiceTable.* INTO " & getTableName(me!txtDate) & _
" FROM InvoiceTable where InvoiceDate = #" & me!txtDate & "#;"

Function getTableName(myDate As Date) As String
getTableName = "Invoices" & Format(myDate, "mdyyyy")
End Function


"JJ" <jjrao@optonline.net> wrote in message
news:86a49515.0402031812.4ef3f62a@posting.google.c om...[color=blue]
> I have a Make Table query which uses a date parameter. Each time the
> user runs the query they will be prompted for a date. The table which
> is created should be named based on the date which they entered. For
> example: The query will retieve all invoices dated xxxxx, the user
> will may supply the date of Jan 1 2004. It should create a table
> called "Jan 1 2004 Invoices" (or something like that). Each table
> created needs to be saved in the database with an appropriate name.
> How can I have the query create a table with a name based on the date
> input?[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.