achalrikhi
New Member
- Joined
- Nov 20, 2013
- Messages
- 38
Dear friends,
I have a form with a table. I actually import the CSV file in to the table and then convert it to the text file.
Importing file with open dialog box is done perfectly. But while exporting it with a save dialog box, the error appears like :
Run-time error '3027' :
Can not update. Database or object is read only.
Can anyone help to resolve this issue ? Here is the code I am using :
Private Sub Command28_Click()
Dim intChoice As Integer
Dim strPath As String
'make the file dialog visible to the user
intChoice = Application.FileDialog(msoFileDialogSaveAs).Show
'determine what choice the user made
If intChoice <> 0 Then
'get the file path selected by the user
strPath = _
Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1)
'displays the result in a message box
Call MsgBox(strPath, vbInformation, "Save Path")
DoCmd.TransferText acExportDelim, "fo Export Specification", "Fo", strPath, True
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM TblFutures;"
DoCmd.SetWarnings True
End If
End Sub
Please guide and suggest a solution.
Thanks & Regards
Achal
I have a form with a table. I actually import the CSV file in to the table and then convert it to the text file.
Importing file with open dialog box is done perfectly. But while exporting it with a save dialog box, the error appears like :
Run-time error '3027' :
Can not update. Database or object is read only.
Can anyone help to resolve this issue ? Here is the code I am using :
Private Sub Command28_Click()
Dim intChoice As Integer
Dim strPath As String
'make the file dialog visible to the user
intChoice = Application.FileDialog(msoFileDialogSaveAs).Show
'determine what choice the user made
If intChoice <> 0 Then
'get the file path selected by the user
strPath = _
Application.FileDialog(msoFileDialogSaveAs).SelectedItems(1)
'displays the result in a message box
Call MsgBox(strPath, vbInformation, "Save Path")
DoCmd.TransferText acExportDelim, "fo Export Specification", "Fo", strPath, True
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM TblFutures;"
DoCmd.SetWarnings True
End If
End Sub
Please guide and suggest a solution.
Thanks & Regards
Achal