Results 1 to 4 of 4
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318

    Clear a Parameter Form


    I have a parameter form I used to enter data for a query. I want it to clear any previous data entered when it opens. I have tried the below without success. I also have the fields defaults set as "" and the form set at yes on data entry.

    Private Sub Form_Open(Cancel As Integer)

    Me.BldgCmb.Value = ""
    Me.StateCmb.Value = ""
    Me.CityCmb.Value = ""
    Me.AddCmb.Value = ""

    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If it's just a parameter form, I wouldn't expect it to be bound to a table, and if it wasn't it would open blank anyway. If you want it bound, you can try the load event instead of the open event, which is too soon to affect data.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,920
    Agree with Paul, controls on an unbound form would be blank when form opens.

    Controls used to input filter parameters should be UNBOUND, otherwise changes data in record.
    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.

  4. #4
    Huddle is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    318
    It isn't bound to a table but when it opens the previous data is still in the field. Maybe it isn't actually closing. I have it hiding until it runs the query. Actually, when I use it in the report is does come up blank so we're all good. It was just doing it when I was working in the form itself.

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

Similar Threads

  1. Replies: 1
    Last Post: 02-28-2013, 01:20 PM
  2. clear form
    By slimjen in forum Forms
    Replies: 1
    Last Post: 05-16-2012, 02:53 PM
  3. Clear Form
    By hithere in forum Access
    Replies: 4
    Last Post: 03-28-2012, 09:28 AM
  4. Form Fields Clear
    By rajulasb in forum Access
    Replies: 1
    Last Post: 08-06-2011, 01:11 AM
  5. How to clear the form?
    By Mrcams in forum Access
    Replies: 3
    Last Post: 01-03-2011, 12: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