I appears I need to basically take a hammer and pound some information into a table because of an error code I am getting due to something imbedded in Windows 7 and XP code that doesn't make any sense. I am getting a run-time error 3051 saying I don't have rights to a table on computers which are running Windows 7. If a computer is running XP it doesnt get the message and runs the append query without any problem. If there is a more graceful way of doing it I am fine with it but if not just making the updates work is all I am wanting to do at this point so the admin team can do their job. Here is the code.
(BTW- Originally, I was just running the Tbl_SDrive_FileNames (This table is a linked table to a file on the network) to append information and then tried to copy the data into a table so the query would have the data in a table that wasn't linked and that didn't work either.)
Any suggestions would be helpful. I had a user login to a Windows 7 machine and they got the error and then an XP machine and the code ran so this is a Windows issue so just getting a hammer out and getting it to work is all I need at this point.
NOTE: Tbl_SDrive_FieldNames is a linked table to a file on the network.
Private Sub Frame85_Click()
Select Case Frame85
Dim i As Integer
Dim sqlfield As String
Call Shell("\\jassrv03\jas-fp$\Documents\filename.bat", vbminimize)
DoCmd.RunSQL "Delete * from tbl_sdrive_temptable"
sqlfield = "INSERT INTO Tbl_SDrive_TempTable ( Field1 )SELECT Tbl_SDrive_FileNames.Field1 FROM Tbl_SDrive_FileNames"
DoCmd.SetWarnings False ' this didn't help but I left the code in as a reference
>>>>> This is where the error code happens regardless of the method used when referencing the Tbl_SDrive_FieldNames file on the network>>>>>
DoCmd.OpenQuery "Qry_NotAttachedFiles", acViewNormal, acEdit
DoCmd.Close acQuery, "Qry_Notattachedfiles", acSaveYes
If IsNull(DLookup("[Document on S Drive]", "No Document Date on File Name (Rename before continuing)")) = False Then
DoCmd.OpenQuery "No Document Date on File Name (Rename before continuing)", acViewNormal, acReadOnly
MsgBox "Import was successful."