I would like to create a table named t_MCRs, utilizing 5 fields from a query, q_MCRs_Only.
Then I would like to also add some new fields to the newly created table immediately after that.
It is preferred that no warnings or popup messages occur. My understanding is I must use the .Execute method to accomplish this but I am having no luck and am getting it to work any way. Here is what I have currently, and it is telling me in debugging that t_MCRs is not defined...
Option Compare Database
Option Explicit
Public Sub createMCRsTable()
Dim dbs As DAO.Database
Set dbs = CurrentDb
Dim strtMCRs As String
Dim MCRQuery As String
strtMCRs = t_MCRs
If Not IsNull(DLookup("Name", "MSysObjects", "Name='" & strtMCRs & "'")) Then
DoCmd.SetWarnings False
DoCmd.Close acTable, strtMCRs, acSaveYes
DoCmd.DeleteObject acTable = acDefault, strTableName
Debug.Print "Table" & strtMCRs & "deleted..."
DoCmd.SetWarnings True
End If
On Error Resume Next
MCRQuery = "SELECT q_MCRs_Only.t_Files_ID, q_MCRs_Only.LastFolderIs, q_MCRs_Only.FName, q_MCRs_Only.Full_MCR_Pathway, q_MCRs_Only.[MCR_Data_Entry_Complete?] INTO t_MCRs;"
End Sub
I am stuck at work til I get this figured out so if anybody is bored I could use a hand or three !!!!!
Thanks,
Bill