S
Song Su
My code worked before, but now has strange message. The error message is:
'ActiveX component can't create object'
My code is below:
Private Sub cmdExport_Click()
On Error GoTo cmdExport_Err
Dim answer As Integer
Dim fs, d
answer = MsgBox("Insert a disk in A: Ready to export?", vbOKCancel +
vbDefaultButton2)
If answer = 1 Then
' Check to see if A: is ready
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive("A:")
If d.IsReady Then
DoCmd.TransferDatabase acExport, "dBase IV", "a:\", acQuery,
"ActiveQuery", "Active.dbf"
MsgBox "Export completed"
Else
MsgBox "A: drive is empty. Export canceled"
End If
Else
MsgBox "Export canceled"
End If
cmdExport_Exit:
Exit Sub
cmdExport_Err:
MsgBox Error$
Resume cmdExport_Exit
End Sub
'ActiveX component can't create object'
My code is below:
Private Sub cmdExport_Click()
On Error GoTo cmdExport_Err
Dim answer As Integer
Dim fs, d
answer = MsgBox("Insert a disk in A: Ready to export?", vbOKCancel +
vbDefaultButton2)
If answer = 1 Then
' Check to see if A: is ready
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive("A:")
If d.IsReady Then
DoCmd.TransferDatabase acExport, "dBase IV", "a:\", acQuery,
"ActiveQuery", "Active.dbf"
MsgBox "Export completed"
Else
MsgBox "A: drive is empty. Export canceled"
End If
Else
MsgBox "Export canceled"
End If
cmdExport_Exit:
Exit Sub
cmdExport_Err:
MsgBox Error$
Resume cmdExport_Exit
End Sub