Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Clear Form on Close (Access 97)

    I have a form that has a combo box selecting a company, after choosing the correct company, address, city, state appear along with a subform with orders. When reopening the form, the address, city, state are still visible. Is there an OnClose command I can use to clear the screen?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Clear Form on Close (Access 97)

    Is your form bound to a Record Source (table, query or SQL statement)? If so, the first record will be displayed when you open the form.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Clear Form on Close (Access 97)

    You said those fields retained their values when you reopened the form. You didn't say, however, whether you actually closed the form or not.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Clear Form on Close (Access 97)

    Yes, I'm completing closing out of the form. The next time I open it, the data from the last time it was open appears.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Clear Form on Close (Access 97)

    Are the Address, City and State bound controls?
    Pat

  6. #6
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Clear Form on Close (Access 97)

    combo box is unbound - city, state, zip are bound

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Clear Form on Close (Access 97)

    Since City, State and Zip are bound controls, as you state, they will display the values of these fields in the first record when the form is opened. You can't expect them to be empty.
    If your form is set up to display the most recently created or modified record as first record, it will seem as if the values from before closing the form are still there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •