Results 1 to 5 of 5
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Need help with VBA command to clear a form and syntax

    I have a form based on a query. When the form opens, rather than displaying the first record in the query, I would like the form to be blank. Is there a command to clear the form?


    I can't find one. If yes, please give me the syntax and the command, or another way to do this. Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why do you want it to be blank? If you only want to allow input of new records and not view existing, set form DataEntry property to yes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Open the form with no recordsource. When you are ready to see a record, set the record source?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    Thanks, June7. That looks much better!

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Quote Originally Posted by msmithtlh View Post
    Thanks, June7. That looks much better!
    Be aware, until you change that property all you can do is ADD records?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Use Command button to clear one table and amend another
    By HotelierDream in forum Programming
    Replies: 7
    Last Post: 12-24-2020, 08:27 AM
  2. Can not fix syntax error in update command
    By database_1 in forum Programming
    Replies: 9
    Last Post: 06-05-2020, 07:18 AM
  3. Replies: 2
    Last Post: 08-07-2019, 08:37 PM
  4. Replies: 3
    Last Post: 05-16-2012, 10:20 AM
  5. Command button code to clear form
    By windwardmi in forum Forms
    Replies: 15
    Last Post: 11-21-2010, 03:21 PM

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