The first action performed is to import an Excel text file. Then I drop the unnecessary columns. Then I rename and modify the remaining columns using the following code:
CurrentDb().TableDefs("SAP_Import").Fields("F1").Name = "PDate"
CurrentDb().TableDefs("SAP_Import").Fields("F2").Name = "Priority"
CurrentDb().TableDefs("SAP_Import").Fields("F9").Name = "Shortage"
CurrentDb().TableDefs("SAP_Import").Fields("F11").Name = "Hours"
CurrentDb().TableDefs("SAP_Import").Fields("F14").Name = "Exists"
CurrentDb().TableDefs("SAP_Import").Fields("Page:").Name = "Wound"
CurrentDb().Execute "alter Table SAP_Import alter column PDate Date"
CurrentDb().Execute "alter Table SAP_Import alter column Priority Double"
CurrentDb().Execute "alter Table SAP_Import alter column Shortage Double;"
CurrentDb().Execute "alter Table SAP_Import alter column Hours Double;"
CurrentDb().Execute "alter Table SAP_Import alter column Exists Double;"
CurrentDb().Execute "alter Table SAP_Import alter column Wound Double;"
Now when I try to use this code to export a copy:
Filename = "c:\Winding\Working\Copy.mdb"
DoCmd.TransferDatabase acExport, "Microsoft Access", Filename, acTable, "Flex_Winder", "Flex_Winder", False
I get an error: "Cannot place this validation expression on this field."
Now, if I go to the actual table and delete just these 6 modified columns it will transfer just fine. I don't understand what I am missing here. Is there anything obvious to any of you ? Thank you for any assistance.
CurrentDb().TableDefs("SAP_Import").Fields("F1").Name = "PDate"
CurrentDb().TableDefs("SAP_Import").Fields("F2").Name = "Priority"
CurrentDb().TableDefs("SAP_Import").Fields("F9").Name = "Shortage"
CurrentDb().TableDefs("SAP_Import").Fields("F11").Name = "Hours"
CurrentDb().TableDefs("SAP_Import").Fields("F14").Name = "Exists"
CurrentDb().TableDefs("SAP_Import").Fields("Page:").Name = "Wound"
CurrentDb().Execute "alter Table SAP_Import alter column PDate Date"
CurrentDb().Execute "alter Table SAP_Import alter column Priority Double"
CurrentDb().Execute "alter Table SAP_Import alter column Shortage Double;"
CurrentDb().Execute "alter Table SAP_Import alter column Hours Double;"
CurrentDb().Execute "alter Table SAP_Import alter column Exists Double;"
CurrentDb().Execute "alter Table SAP_Import alter column Wound Double;"
Now when I try to use this code to export a copy:
Filename = "c:\Winding\Working\Copy.mdb"
DoCmd.TransferDatabase acExport, "Microsoft Access", Filename, acTable, "Flex_Winder", "Flex_Winder", False
I get an error: "Cannot place this validation expression on this field."
Now, if I go to the actual table and delete just these 6 modified columns it will transfer just fine. I don't understand what I am missing here. Is there anything obvious to any of you ? Thank you for any assistance.