Results 1 to 4 of 4
  1. #1
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66

    MsgBox to update field. What's next?


    Code:
    Private Sub AMOUNT_BeforeUpdate(Cancel As Integer)
    
    Select Case MsgBox("Are you sure?", vbYesNo)
    Case Is = vbYes
    Case Is = vbNo
    I am brand new to Visual Basic stuff. How would finish the code to allow and edit to be made to a field if "yes" is selected?

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536

  3. #3
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    Quote Originally Posted by alansidman View Post
    That's pretty ironic. I saw another thread with that video on it and I just wrote my first bit of code off of it.

    I'll watch again, and then comb through some others.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Since you are using the BeforeUpdate event, take advantage of the Cancel argument.
    If MsgBox("Are you sure?", vbYesNo) = vbNo Then
    'cancel update and return to the AMOUNT control
    Cancel = True
    End If

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

Similar Threads

  1. MsgBox Placement
    By tpcervelo in forum Programming
    Replies: 2
    Last Post: 12-27-2010, 07:36 AM
  2. Update field in subform from field in Main
    By jpkeller55 in forum Access
    Replies: 9
    Last Post: 10-15-2010, 03:37 PM
  3. Update field in table after update on a subform
    By jpkeller55 in forum Queries
    Replies: 3
    Last Post: 09-30-2010, 08:02 PM
  4. Custom MsgBox
    By roccoIT in forum Programming
    Replies: 3
    Last Post: 07-06-2010, 10:43 AM
  5. Yes No Cancel MsgBox
    By Rick West in forum Forms
    Replies: 5
    Last Post: 04-14-2010, 08:57 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