Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Access Getting Started > Problem with ap...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 16799 of 17622
Post > Topic >>

Problem with append query

by =?Utf-8?B?UGF1bDNyZA==?= <Paul3rd@[EMAIL PROTECTED] > Jul 25, 2008 at 11:49 AM

Hello, I'd like to use an append query in a On Click event to update my
table 
from 
an Excel spreadsheet.
The table is named Air_Filters, and the spreadsheet resides on C: with
full
permissions set for Everyone.
I'm using the following code for the query:

INSERT INTO [Air_Filters]
SELECT *
FROM [TEXT;HDR=YES;DATABASE=C:\].AirFilters.xls;

The following code for the button:

Private Sub Command23_Click()
On Error GoTo Err_Command23_Click

    Dim stDocName As String
    Dim AFUP As Integer

    stDocName = "AirFilters"
    AFUP = MsgBox("Delete & Replace all air filters?", vbOKCancel, "Air 
Filter Update")
    
    If AFUP = 1 Then
        DoCmd.SetWarnings False
        DoCmd.OpenQuery stDocName, acNormal, acEdit
        DoCmd.SetWarnings True
    Else
        MsgBox ("Update Cancelled")
    End If
Exit_Command23_Click:
    Exit Sub

Err_Command23_Click:
    MsgBox Err.Description
    Resume Exit_Command23_Click
    
End Sub

The problem is that On Click I get the following error;
"Cannot update. Database or object is read-only."
Again my spreadsheet AirFilters.xls is not marked as read-only, and full 
permissions are set for everyone.
Can anyone offer a suggestion?
Thanks in advance for any help.
Paul
 




 3 Posts in Topic:
Problem with append query
=?Utf-8?B?UGF1bDNyZA==?=   2008-07-25 11:49:25 
Re: Problem with append query
"Bob Larson" &l  2008-07-27 10:06:28 
Re: Problem with append query
"bhicks11 via Access  2008-07-27 19:34:58 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 19:59:27 CST 2008.