Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010

    Unanswered: listbox afterupdate property

    I have a list box that i used to select different assets on a form. When an asset is selected in the listbox it displays all the information for that asset.

    If i edit a field and then select a different asset, it will save the edit i made. I want to disable this.

    if i select asset 1 and edit field 1, then select asset 2 and then go back to asset 1, i do not want it to apply the edit i made. I would like to make a "save" button instead.

    here is the List100_AfterUpdate() code that applies to my form.

    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[AssetID] = " & Str(Nz(Me![List100], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    does the problem reside in the code?

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 15
    The problem is not with the code you use. If the form is bound to a data source (table or query) and if it allows editing, this is the normal behaviour in Access.

    If you do not allow editing in the form (form property AllowEdits set to False, form property RecordsetType set to Snapshot or controls property Locked set to True), you won't be able to modify the values displayed in the controls.

    For what you're looking for you must use an unbound form or a bound form with the controls not bound to the fields of the form recordset (i.e., controls with the ControlSource property left empty). In both case you must write VBA code to transfer the data from the data source to the controls, and from the controls to the data source when you press the Save button you're talking about.
    Have a nice day!

  3. #3
    Join Date
    Apr 2010

    hahaha i appreciate the response. due to the amount of fields i have on my form and how much i have done i think i am just going to let this be.

    maybe when i get time to do a large update i will set it up that way

    Thanks for your help

  4. #4
    Join Date
    Apr 2010
    so i got some free time and started to build a form to the way you suggested. now i notice that the filter by form button is grayed out (not usable) on my toolbar. Is this feature not possible when a form is built in this fashion?

Posting Permissions

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