Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2004

    Unanswered: On Click Error: Operation must use an updateable query

    Hey group,
    I have a MDE database with a backend running on a network drive. I've been making some upgrades and recently during some testing other users have gotten following message when trying to update a password:

    The expression On Click you entered as the event property setting produced the following error: Operation must use an updateable query.
    ·The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
    ·There may have been an error evaluating the function, event, or macro

    What I have is a form that has two blanks for typing and retyping the password, and if they both match the following code is run:

    DoCmd.RunSQL "UPDATE tblUsers SET tblUsers.PW = '" & Me.txtChangePWConfirm.Value & "' " & _
    "WHERE (((tblUsers.ID)='" & Me.txtChangePWID.Value & "'));"
    The txtChangePWConfirm is the text box that the value is taken from. txtChangePWID is the ID number to match the record in the User table so it changes the right password. The thing about this is that I can't duplicate the problem myself. Also, I didn't change this part from the original, which works fine for everyone right now. The program runs using Access Runtime. I believe most people are using 2002. I'm running 2003. Any ideas what might be causing this problem? Thanks for any help.

  2. #2
    Join Date
    Dec 2002
    Préverenges, Switzerland
    couple of convenience items:

    you don't need the .Value
    it is the default property so e.g. Me.txtChangePWConfirm is enough
    ...but you do no harm with .Value so if this is your style, fine.

    have an experiment with
    currentdb.execute "Some SQL stuff"
    instead of
    docmd.runsql "Some SQL stuff"
    - it is faster
    - you dont get the mad warning message (or you save yourself the hassle and the risk of turning Warnings off)

    moving along to your real question, what sort of beast is tblUsers.ID ?
    you are treating it as text.
    is it? (your post calls it an ID number)
    if numeric, drop both ' in
    '" & Me.txtChangePWID.Value & "'

    currently using SS 2008R2

  3. #3
    Join Date
    May 2004
    whenever I get the "must be an updateable query" error it is because I am trying to use an append query with a table that does not have a primary key defined. Hope that helps.

  4. #4
    Join Date
    Feb 2004
    Chicago, IL
    You might want to check the user's permissions for the folder that the backend is in. If it only happens to some people and not others I would imagine that the backend is being opened as a read-only database.

    I have a different opinion about .Value than Izy. I read that if you should always specify the default property for a object so that when Microsoft decides to change the default property you won't have to change your code. Apparently this was a problem with database that were converted from Access 2.0 to Access 97.

  5. #5
    Join Date
    Dec 2002
    Préverenges, Switzerland
    you could very well be right DCK
    at 2.0 time i was still dbase and a bunch of home-brews in Pascal so i didn't hit that particular wall (i hit very many others!)
    .Value does no harm at all as i said

    meanwhile WilliamS:
    what sort of beast is tblUsers.ID is it numeric? or text?
    what is your objection to a PK?
    and maybe worth a try: delete from frontend (!only! from frontend - does not harm backend tables) all linked tables. then relink same.

    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts