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

  • Thread starter Thread starter traygo
  • Start date Start date
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
 
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
& " ....."
 
Back
Top