Help!
I have a simple form, tied to a 3-field table, built by the form wizard. I added an unbound listbox, and using the wizard, told it to look up a record based on which list item I choose. Instead of using a rowsource for the listbox, I used a function to fill the list, and put its name in the Row Source Type property. The function contains SQL code to look up the values in the list box using ADO. So far so good… everything works properly. When I click on a list item, that record comes up on the form. I also have a Save button on the form, with wizard-generated code to save the record (DoCmd.DoMenuItem…..).
I put code in the save button to requery the list, and re-select the item in the list, so if I change a field on the form, that column of the list will also be changed. Of course, if I add a record, I want it inserted in the list.
Here’s the problem(s):
1: If I change a description field, it doesn’t update the list after I hit the Save button. But… if I click the save button several times, it sometimes does update the list. If I exit the form, then come back, everything is ok, the list reflects the new field value. I’ve tried putting in DoEvents after the save, before the requery. I’ve tried putting the requery in the Form_AfterUpdate event instead of the Save button click event. Nothing works.
2: The undo button on the toolbar is active after I save the record, and it shouldn’t be. If I hover over it, the tool tip says “Undo saved record”. This is strange.
I believe these 2 problems are related. Why would Access offer to undo a saved record once it’s saved. Is there any way to turn off this state of affairs so Access doesn’t think there’s something to undo after I’ve saved the record?
Thanks,