Results 1 to 2 of 2
  1. #1
    mrmims is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2013
    Posts
    53

    Yes/No Data Macro Question? "NO" Click is not working

    Hello,



    I have an inventory database with an "Expected Quantity" field. Whenever a user goes to change this field, a "Before Update" macro runs questioning if they are sure they want to changed this quantity. I am having issue when the user hits "no". How do I undo the change and have the value go back to its original when the user clicks "No". Currently I get an error message. This is what I have as my data macro:

    Code:
    If MsgBox("Are you sure you wish to change the Expected Quantity?",4)=7 Then 
    
    RunMenuCommand 
    UndoRecord
    
    CancelEvent
    End If
    The Error Message I get when I click "No" is:

    Code:
    The command or action 'UndoRecord' isn't available now.
    
    *You may be in a read-only database or an unconverted database from an earlier version of Microsoft Access
    *The type of object this action applies to isn't currently selected or isn't in the active view
    
    Use only those commands and macro actions that are currently available for this database
    *Not working with a read only or an unconverted database
    *Object is selected as I just changed the value and it is in the active view

    As a side note, when I click "Yes" everything works swimmingly.

    What am I doing wrong?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    How about...

    If MsgBox("Are you sure you wish to change the Expected Quantity?",4)=7 Then
    me.ControlName.setfocus
    Cancel = true
    End If

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

Similar Threads

  1. Fill in data into table upon "on click"
    By teekc in forum Forms
    Replies: 4
    Last Post: 04-01-2014, 08:27 PM
  2. Replies: 2
    Last Post: 01-03-2014, 09:35 AM
  3. saves data with out click "Save" button in forms
    By terrythomasvda in forum Forms
    Replies: 4
    Last Post: 01-14-2013, 01:31 PM
  4. Replies: 2
    Last Post: 04-24-2012, 01:15 PM
  5. Using "On Click" or "On Dbl Click" in a Switchboard
    By James Parker in forum Access
    Replies: 2
    Last Post: 01-12-2012, 11:00 AM

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