Query

J

Jacob

Is there a way to create a table from a query and give the table a
different name each time? Or is there code that will allow me to do this?
 
J

John Vinson

Is there a way to create a table from a query and give the table a
different name each time? Or is there code that will allow me to do this?

It's possible using VBA code... but it is A VERY BAD IDEA.

MakeTable queries are *occasionally* useful, but it's very rare. Bear
in mind that you can use a Select Query as the source of a Form, of a
Report, of another Query, as a source for an export to Excel or some
other external format... only rarely do you need a new table. Also,
table names are NOT searchable; if you proliferate a lot of tables you
will have great difficulty later on figuring out which table is which.

What are you trying to *accomplish* in the real world? I strongly
suspect there's a better way!
 
J

Jacob

I am changing data in my data based on a yearly basis. Once a year, I will
need to update to a new table. I am creating a time off data base and I
cannot seem to get the dates to work for only the current year. Each year we
are given X amount of vacation days, personal days and sick days. Each year,
that needs to be reset to 0 since the days do not carry over. I was thinking
that I could create a macro or query to do this for me, but I would need to
name each table to the year it corresponds to. I will need to keep the
previous years available for looking back. I'm sure you know an easier way,
I am somewhat a novice when it comes to code. I can do a lot, but when it
comes to the coding, I am slowly learning.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top