Results 1 to 6 of 6
  1. #1
    an1bone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    9

    Refreshing a form upon opening

    Hello,

    I have created a form to enter new records that will be saved into an existing table. I have multiple textboxes where administrators will be able to enter in new part numbers, image file locations, hyperlinks to documents, etc. I added an Add Record command button (to add the new record to the table), as well as an Undo Record command button (to get rid of the data partially entered into this form). My problem is that whenever I open the form up, it displays all of the data for a previous record already saved in the table. I need to click the Add Record button in order for this data to go away and then add a new record. Also, an error message comes up saying the Undo command isn't available when I try to click Undo Record to remove this data upon opening the table. What macro can be used to sort of "refresh" this form when it is opened? I've tried adding Refresh when opening and loading, but it just comes up with an error message. I just want the form to come up free of data when it opens. Thank you for your help!!!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    the form is resting on the last record,
    if you want to open it for data entry ,new record, then

    docmd.openform "frmMyform",,,,acFormAdd

  3. #3
    an1bone is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    9
    Where do I use this docmd.openform "frmMyform",,,,acFormAdd ?? I'm still fairly new to access...

  4. #4
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    Wherever it is that you're opening the form from. If a button opens the form, use ranman's code in the button click event

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    how is the form opened to begin with?
    is it opened when the db opens?
    is it opened when a user clicks a button on the main menu?

  6. #6
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    If you are using a macro to open the form you need to change data mode to ADD. It will open on a new every time then. If you then take off any navigation it will always be a blank form when opened through that button and the same form can be used to open specific records also.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-24-2015, 12:59 AM
  2. Refreshing a table from the form
    By ddkolb in forum Access
    Replies: 1
    Last Post: 08-08-2014, 12:21 AM
  3. Refreshing the form vs. requerying
    By Access_Novice in forum Forms
    Replies: 9
    Last Post: 01-01-2014, 07:24 PM
  4. Replies: 0
    Last Post: 11-23-2011, 04:06 PM
  5. Refreshing queries without opening them
    By trialpayjinn in forum Access
    Replies: 3
    Last Post: 07-01-2010, 05:04 PM

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