Results 1 to 6 of 6
  1. #1
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352

    Having Trouble With Undo Function

    I have a reset button that resets the form back to a blank form. It worked fine as just Me.Undo behind the button. Now I would like to prompt the user whether they truly want to reset the form (in case they accidently click it).
    Currently,
    Code:
    Private Sub btnReset_Click()
    Dim UseResponse As Integer
    UseResponse = MsgBox("Undo entries?", vbYesNo, "Undo")
    If UseResponse = vbYes Then
    Me.Undo
    Else
    End If
    End Sub
    But the undo portion does not work at all.
    Last edited by nick404; 06-25-2015 at 01:59 PM. Reason: Edit: left an s out and that is why the error was occuring

  2. #2
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Wow, there was a typo in my code
    It works now. BUT
    my first two fields, one a combo box and one a text box do not clear. All the others in the form clear (they are a mix of combos and txts). Any ideas as to why these two are being stubborn? Same code as above.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,545
    Have you tried stepping through the code at run time and examining the value of UseResponse etc
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    can you explain what you mean at run time?

  5. #5
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    It's because those two were unbound, my bad. Overlooked the small details!

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,545
    Quote Originally Posted by nick404 View Post
    can you explain what you mean at run time?
    While the code is actually running by putting a breakpoint at the start of the code and then stepping through it one line at a time.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. to Undo, or not to Undo...
    By Davince in forum Forms
    Replies: 2
    Last Post: 02-19-2015, 07:23 PM
  2. Trouble with string variable in custom vba function
    By CurrentUser in forum Programming
    Replies: 4
    Last Post: 01-10-2014, 09:13 PM
  3. Replies: 7
    Last Post: 10-04-2013, 11:45 AM
  4. Replies: 13
    Last Post: 11-02-2012, 01:19 AM
  5. Having Trouble Returning Array from Function
    By NigelS in forum Programming
    Replies: 8
    Last Post: 08-15-2011, 07:12 AM

Tags for this Thread

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