I have a form bound to record source "qryVehicleInventory"
The form header has a listbox called "lstVehCfg". That listbox is bound to field "VehConfigID".
When you select an item in the list, I use the AfterUpdate event to filter the main form records in "qryVehicleInventory" by "VehConfigID"
Now, the listbox has a field called "Notes". The notes can be long (don't fit in list box), so I wanted an unbound text box that could show the full notes for the selected item form the listbox. So I added the following to the AfterUpdate event of the listbox.
Me.txtConfigNotes = DLookup("[Notes]", "tblVehConfig", "[VehConfigID] = Forms!frmVehicleSelection.lstVehCfg")
Here's the problem. If the selected item from the listbox has matching items records to show after the filter has been applied, the Notes field displays correctly. However, if the selected listbox item has zero matching records to display, the "Notes" textbox does not update and instead still shows the last selected items notes.
Help...
The form header has a listbox called "lstVehCfg". That listbox is bound to field "VehConfigID".
When you select an item in the list, I use the AfterUpdate event to filter the main form records in "qryVehicleInventory" by "VehConfigID"
Now, the listbox has a field called "Notes". The notes can be long (don't fit in list box), so I wanted an unbound text box that could show the full notes for the selected item form the listbox. So I added the following to the AfterUpdate event of the listbox.
Me.txtConfigNotes = DLookup("[Notes]", "tblVehConfig", "[VehConfigID] = Forms!frmVehicleSelection.lstVehCfg")
Here's the problem. If the selected item from the listbox has matching items records to show after the filter has been applied, the Notes field displays correctly. However, if the selected listbox item has zero matching records to display, the "Notes" textbox does not update and instead still shows the last selected items notes.
Help...