dialog input to get part of table name for a make-table query

T

traygo

Archive data every year, have make-table qryArchiveData, which makes a
table named tblArchivedData. What I would like to do is, ask user for
input, "What year are you archiving?" and then append that to the new
table, so the result would be: tblArchivedData2009 (if they input
2009). (can't use System Date, as it might or might not be the current
year)

Can this be done, or only with SQL using VBA?

Thanks, Josh
 
D

Duane Hookom

I expect you need a little code use DAO code to modify the SQL property of
the saved make table query.

Currentdb.QueryDefs("qryArchiveData").SQL = "SELECT INTO ... " & Me.txtYear
& " ....."
 

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