We moved a database from ms access 2003 to SQL server 2000. We kept all queries in ms access. Can someone please tell me what is wrong with this code, I'm getting the error " problems obtaining data" when it tries to import the data into excel.
it's supposed to import data to an excel spreadsheet.
Private Sub cmdcaseload_Click()
On Error Resume Next
DoCmd.DeleteObject acTable, "FirstTimeClients"
DoCmd.OpenQuery "clients_first_time_Table"
DoCmd.DeleteObject acTable, "Clients"
DoCmd.DeleteObject acTable, "caseload"
DoCmd.DeleteObject acTable, "ftc"
If IsNull(d3) Then
DoCmd.OpenQuery "ftc_Table"
DoCmd.OpenQuery "clients_Table"
DoCmd.OpenQuery "outcome_caseload_table"
Else
DoCmd.OpenQuery "ftc_Table_after"
DoCmd.OpenQuery "clients_Table_after"
DoCmd.OpenQuery "outcome_caseload_table_after"
End If
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "ftc", "ftc", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "firsttimeclients", "firsttimeclients", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "clients", "clients", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "caseload", "caseload", False
Call Shell("EXCEL.EXE c:\work\satp\caseload.xls", 1)
it's supposed to import data to an excel spreadsheet.
Private Sub cmdcaseload_Click()
On Error Resume Next
DoCmd.DeleteObject acTable, "FirstTimeClients"
DoCmd.OpenQuery "clients_first_time_Table"
DoCmd.DeleteObject acTable, "Clients"
DoCmd.DeleteObject acTable, "caseload"
DoCmd.DeleteObject acTable, "ftc"
If IsNull(d3) Then
DoCmd.OpenQuery "ftc_Table"
DoCmd.OpenQuery "clients_Table"
DoCmd.OpenQuery "outcome_caseload_table"
Else
DoCmd.OpenQuery "ftc_Table_after"
DoCmd.OpenQuery "clients_Table_after"
DoCmd.OpenQuery "outcome_caseload_table_after"
End If
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "ftc", "ftc", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "firsttimeclients", "firsttimeclients", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "clients", "clients", False
DoCmd.TransferDatabase acExport, "Microsoft Access", "c:\work\drb.mdb", acTable, "caseload", "caseload", False
Call Shell("EXCEL.EXE c:\work\satp\caseload.xls", 1)