This is the import code :
Code:
Private Sub Yes_Click()
Me.tbHidden.SetFocus
DoCmd.RunSQL ("DROP TABLE AnimeTab")
DoCmd.RunSQL ("DROP TABLE TypeTab")
DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "AnimeTab", "AnimeTab", False
DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "TypeTab", "TypeTab", False
DoCmd.Close acForm, "ImportForm", acSaveNo
DoCmd.OpenForm "MenuForm", acNormal
End Sub
Right now I'm trying to make sure that if the table doesn't exist in the database, it won't stop the process... but I can't get it to work... I tried this :
Code:
Private Sub Yes_Click()
Me.tbHidden.SetFocus
If AnimeTabTableExists Then
DoCmd.RunSQL ("DROP TABLE AnimeTab")
If TypeTabTableExists Then
DoCmd.RunSQL ("DROP TABLE TypeTab")
Else
DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "AnimeTab", "AnimeTab", False
DoCmd.TransferDatabase acImport, "Microsoft Access", (tbFile), acTable, "TypeTab", "TypeTab", False
DoCmd.Close acForm, "ImportForm", acSaveNo
DoCmd.OpenForm "MenuForm", acNormal
End If
End If
End Sub
But nothing happens... no error... no import... just nothing. I'm not sure about the If AnimeTabTableExists Then step.