First time post and long time viewer.
I have a split database that pulls information from two sources. I combine the data through several queries and then write a table with the finished product for use in Excel charts.
There are 230 records in qry_FTC_3 and only 187 records write. The difference is all records with a Year of 2020, also those records are all from one of the two data sources. I receive no errors, the data just doesn't write. I'm guessing somewhere up the chain of queries, the new data has something that doesn't match, but doesn't cause an error in Merge Queries or MS Access 2016?
I have a split database that pulls information from two sources. I combine the data through several queries and then write a table with the finished product for use in Excel charts.
There are 230 records in qry_FTC_3 and only 187 records write. The difference is all records with a Year of 2020, also those records are all from one of the two data sources. I receive no errors, the data just doesn't write. I'm guessing somewhere up the chain of queries, the new data has something that doesn't match, but doesn't cause an error in Merge Queries or MS Access 2016?
Code:
Private Sub Command42_Click()
On Error GoTo Err_Handler
Dim sql12 As String
sql12 = "Delete tbl_FTC.* FROM tbl_FTC;"
CurrentDb.Execute (sql12)
Me.Refresh
Me.Requery
sql12 = "INSERT INTO tbl_FTC ([Day], [CostCode], [CostType], [IDNo], [Name], [Hrs], [UOM], [Costs]) SELECT [Day], [CostCode], [CostType], [IDNo], [Name], [Hrs], [UOM], [Costs] FROM qry_FTC_3;"
Debug.Print (sql12)
CurrentDb.Execute (sql12)
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Handler
End Sub