I have run into a peculiar issue. I have some code that does the transfer spreadsheet method to import excel files into my database. I have temporary tables setup to receive each particular excel file to be imported.
All of that works just fine with no hiccups, until I split the database. Once split, something that worked just fine, breaks. I now get Run-time error '3349': You cannot record you changes because a value you entered violates the settings defined for this table or list. Comparing the newly split tables with a backup, they are exactly the same across the board, including structure and properties.
To make trouble shooting even harder for me, when I delete that particular version of the database and split it again via the back up, the vba for a different import breaks (I have 6 buttons for different vendors since the excel being imported is structured differently for each but only difference is the destination table).
Why is this happening and how can I correct it?
EDIT:
Adding code for reference. Shout out to theDBGuy, as he was kind enough to initially write this for me.
All of that works just fine with no hiccups, until I split the database. Once split, something that worked just fine, breaks. I now get Run-time error '3349': You cannot record you changes because a value you entered violates the settings defined for this table or list. Comparing the newly split tables with a backup, they are exactly the same across the board, including structure and properties.
To make trouble shooting even harder for me, when I delete that particular version of the database and split it again via the back up, the vba for a different import breaks (I have 6 buttons for different vendors since the excel being imported is structured differently for each but only difference is the destination table).
Why is this happening and how can I correct it?
EDIT:
Adding code for reference. Shout out to theDBGuy, as he was kind enough to initially write this for me.
Code:
Public Function ImportXLSpectrum() As Boolean
'thedbguy@gmail.com
'10/9/2020
Dim fd As Object
Dim strFile As String
Set fd = Application.FileDialog(3)
With fd
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Excel Files", "*.xls*"
If .Show Then
strFile = .SelectedItems(1)
End If
End With
If strFile = "" Then
ImportXL = False
Else
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "tblTempSpectrum", strFile, True
ImportXL = True
End If
Set fd = Nothing
End Function
Last edited: