G
Guest
I have an application that uses export/import to back up data ( i.e. each
day, the user exports data to "my documents" and then has the data available
for import in case of program failure or when I update the application).
Export code
Private Sub Command11_Click()
On Error GoTo Command11_Click_Err
DoCmd.GoToRecord acForm, "gxt version 3", acNext
DoCmd.GoToRecord acForm, "gxt version 3", acPrevious
DoCmd.OutputTo acTable, "GXT Cardiolite table",
"MicrosoftExcelBiff8(*.xls)", "", False, "", 0
Exit Sub
Command11_Click_Exit:
Exit Sub
Command11_Click_Err:
MsgBox "You have not selected anything to save to export",
vbInformation, "RS, Inc."
Resume Command11_Click_Exit
End Sub
Import code
Private Sub Command12_Click()
On Error GoTo Command12_Click_Err
DoCmd.TransferSpreadsheet acImport, 5, "gxt cardiolite table", "gxt
cardiolite table", True, ""
Command12_Click_Exit:
Exit Sub
Command12_Click_Err:
MsgBox "You have not selected anything to import", vbInformation, "RS,
Inc."
Resume Command12_Click_Exit
End Sub
The export code successfully exports the table to the "my documents" folder.
The import code imports a file by the same name but it is an older file that
was exported in the past- it is not the same one I just exported to the "my
documents" folder.
I have been messing around with this application and have multiple versions
and pieces of the application in various stages of development and possible
my application is importing the file from one of the many versions that I
have ??????
Questions:
1. How can I export the data ( allowing the user to specify the file name)
to "my documents" and then import that same data (specifically from "my
documents")
Is it OK to export using "output to actable" and import using
transferspreadsheet?
How do I allow the user to specify the file he wants to import when
using transferspreadsheet?
Thanks
Phil
day, the user exports data to "my documents" and then has the data available
for import in case of program failure or when I update the application).
Export code
Private Sub Command11_Click()
On Error GoTo Command11_Click_Err
DoCmd.GoToRecord acForm, "gxt version 3", acNext
DoCmd.GoToRecord acForm, "gxt version 3", acPrevious
DoCmd.OutputTo acTable, "GXT Cardiolite table",
"MicrosoftExcelBiff8(*.xls)", "", False, "", 0
Exit Sub
Command11_Click_Exit:
Exit Sub
Command11_Click_Err:
MsgBox "You have not selected anything to save to export",
vbInformation, "RS, Inc."
Resume Command11_Click_Exit
End Sub
Import code
Private Sub Command12_Click()
On Error GoTo Command12_Click_Err
DoCmd.TransferSpreadsheet acImport, 5, "gxt cardiolite table", "gxt
cardiolite table", True, ""
Command12_Click_Exit:
Exit Sub
Command12_Click_Err:
MsgBox "You have not selected anything to import", vbInformation, "RS,
Inc."
Resume Command12_Click_Exit
End Sub
The export code successfully exports the table to the "my documents" folder.
The import code imports a file by the same name but it is an older file that
was exported in the past- it is not the same one I just exported to the "my
documents" folder.
I have been messing around with this application and have multiple versions
and pieces of the application in various stages of development and possible
my application is importing the file from one of the many versions that I
have ??????
Questions:
1. How can I export the data ( allowing the user to specify the file name)
to "my documents" and then import that same data (specifically from "my
documents")
Is it OK to export using "output to actable" and import using
transferspreadsheet?
How do I allow the user to specify the file he wants to import when
using transferspreadsheet?
Thanks
Phil