none
Forms RRS feed

  • Question

  • Using ACCESS 2013. Have a form with list box fed by a query. Have command button to a report. Select item from list, click button and report is produced. When I close the form, database used by the query updates a record incorrectly. I don't want the form to do this.
    Monday, August 12, 2019 2:28 AM

All replies

  • There is no way a listbox selection itself can modify the data of its source query.

    So, something else is going on. Could be your form if bound to the same query; if so, edit the query to make it read-only.


    Gustav Brock

    Monday, August 12, 2019 6:38 AM
  • "When I close the form, database used by the query updates a record incorrectly."

    Can you explain more in detail what is going on vs. what you are expecting as a result?
    Does your form have any events (Close, unload, ...)?
    Can you post the code behind your form?


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Monday, August 12, 2019 1:38 PM
  • I'd hazard a guess that the list box might be bound to a column in a bound form.  At the very least the list box should be unbound, i.e. its ControlSource property should be empty.  Also a list box like this would more usually be in an unbound dialogue form, but there is nothing to say you cannot include it in a bound form, provided that the list box is unbound.  What you cannot do, however, is use the same control to edit data in the form's recordset, and to select a value by which to restrict a report's results.  You'd need separate controls for each.

    Ken Sheridan, Stafford, England

    Monday, August 12, 2019 6:37 PM