Results 1 to 2 of 2
  1. #1
    Skroof is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Location
    South Africa
    Posts
    21

    Macro to add and clear fields


    Macro to add and clear fields - I added a new "add record" button and this time i am controlling it using the macro, it saves data to its table but does not clear thereafter, so i have to manualy remove what was typed in. How can i add another macro to add record to table and the clear it off the list boxes or fileds ?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I don't use macros, but if the form is bound to a table/query, then I don't think you need code or a macro to save the entered data. Just moving to another record (existing or new) will cause access to save the data. So, you could create a macro that uses the GoToRecord action and select "new" from the list of available records. Or better still you could do it with one line of code:
    DoCmd.GoToRecord , , acNewRec
    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. Clear some fields and not others
    By funkygoorilla in forum Access
    Replies: 12
    Last Post: 08-23-2011, 07:38 AM
  2. Form Fields Clear
    By rajulasb in forum Access
    Replies: 1
    Last Post: 08-06-2011, 01:11 AM
  3. Replies: 5
    Last Post: 07-19-2011, 11:56 AM
  4. Clear fields in a record
    By stryder09 in forum Access
    Replies: 9
    Last Post: 05-12-2011, 01:34 PM
  5. Replies: 1
    Last Post: 12-21-2010, 09:27 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