Results 1 to 7 of 7
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    Operation must be an updateable query! Arg

    Alright, I have a front end, and a back end. Everytime a user clicks a front end button, the function does an insert query to the backend thru this query...


    Code:
    INSERT INTO tblFuncLog ( chrUser, chrFunction, dtmTimeStamp )
    SELECT Environ("username") AS Expr1, [screen].[activecontrol].[name] AS Expr3, Now() AS Expr2;
    We are running into a problem with SOME users they are receiving the message

    "Operation must be an updateable query"



    I am very lost, any assistance would be appreciated.

    If I can help by providing anymore information please let me know.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    This is a saved Access query, not VBA constructed SQL?

    AFAIK, Access does not recognize Environ() function, VBA does. So put the function in a custom function and call the UDF from the query

    Public Function GetUser()
    GetUser = Environ("USERNAME")
    End Function

    INSERT INTO tblFuncLog ( chrUser, chrFunction, dtmTimeStamp )
    SELECT GetUser() AS Expr1, [screen].[activecontrol].[name] AS Expr3, Now() AS Expr2;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Hmm, well I have this in the vba code

    Code:
    Public Function Environ(username)
    On Error GoTo Err_Environ
    
    
    Environ = VBA.Environ(username)
    
    
    Exit_Environ:
    Exit Function
    
    
    Err_Environ:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Environ
    
    
    End Function
    So I am going to try your code, see what happens

    Edit - Yes it is a saved query in access

  4. #4
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Alright, so it is working on my machine. Once someone comes in that was receiving the error comes in I will deploy/test/report the results. My question is why would this error ONLY be happening for certain users?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    All using the same version Access and OS?

    I would not give a UDF same name as intrinsic function.

    Your original function has wrong syntax for VBA.Environ(). USERNAME must be within quote marks. Otherwise, triggers run-time error 5. The error handler should deal with that but not sure what is happening.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Alright, I just tried on one of the users machines. Odd thing, when the FE was an MDB it worked fine with your code. HOWEVER, when it was an mde the same error message occurs.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    Sorry, no experience with MDE, never converted db.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 03-30-2012, 12:11 PM
  2. Replies: 5
    Last Post: 01-11-2012, 04:26 PM
  3. Operation must use an updateable query.
    By pericherlasuma in forum Access
    Replies: 1
    Last Post: 05-16-2011, 09:45 AM
  4. Operation must use an updateable query
    By skaswani in forum Queries
    Replies: 0
    Last Post: 12-23-2010, 11:59 PM
  5. Operation Must use an Updateable Query
    By Lady_Jane in forum Queries
    Replies: 2
    Last Post: 12-14-2010, 03:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums