Results 1 to 3 of 3
  1. #1
    tndinnc is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11

    Question Clear Data Entry in Datasheet SubForm Problem

    I have subform in datasheet view. The subform allows the user to add additional information relating to the order on the main form. All the fields on the subform are required. I have code in the beforeupdate for this subform. If a user tries to leave the row (click the next row or outside the subform) before all the required information is filled out, it presents a message saying x,y,z is required you wish to continue Yes or No. Yes works fine - it lets them go back to data entering. No - doesn't work. what I want to happen here is to set the subform back to what it was before they started entering the new record. I've tried setting cancel = true then me.refresh, me.requery, also tried setting the controls values to null or "" ... nothing works. Anyone have any suggestions on what I am doing wrong here?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I would try adding a line before the Cancel = TRUE line:
    (-- untested --)
    Code:
    ' code
      Me.Undo
      Cancel = TRUE
    'more code
    Also, see the response by Allen Browne at
    http://www.pcreview.co.uk/forums/dif...-t1162440.html

  3. #3
    tndinnc is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    11
    That worked great thanks!

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

Similar Threads

  1. Replies: 5
    Last Post: 08-12-2013, 12:53 AM
  2. Replies: 8
    Last Post: 08-26-2012, 11:11 PM
  3. Replies: 13
    Last Post: 02-26-2012, 08:28 AM
  4. Replies: 7
    Last Post: 07-15-2011, 01:58 PM
  5. Printing fildered subform datasheet problem
    By dinorbaccess in forum Forms
    Replies: 9
    Last Post: 01-08-2011, 05:15 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