Full Version: Clearing Out A Combo Box
UtterAccess Forums > Microsoft® Access > Access Forms
Dp0756
I have an unbound form that is used for finding a work order. The user can look up an airplane, and can click on the combo box to get a list of the work orders.
ere's the SQL for the combo box
SELECT tblWorkOrders.ID, tblWorkOrders.numWrkOrder, tblWorkOrders.dtSchedDateIn, tblWorkOrders.txtStatus, tblWorkOrders.txtDescr FROM tblWorkOrders WHERE (((tblWorkOrders.numN)=[form]![Nid]));
When a work order is selected I'm able to update the form just fine.
The problem I'm having is when I go to look up a different N number I can't clear out the combo box, and it keeps linking to the previous N number.
Thanks for any advice.
Dan
pere_de_chipstick
Hi Dan
henever you look up or change the 'subject' (an aeroplane) which is the ID in your combo row source filter criteria, then you need to requery the combo box. Hence in the after update event of the control that looks up the aeroplane you should have the code line "Me.ComboBoxName.Requery"
hth
Dp0756
That did it - thank you - I still have the old work order showing in the window - however clicking on the drop down now correctly shows the proper work orders. What command would I use after the .requery to blank out that selection?
pere_de_chipstick
Try:
!--coloro:#FF0000-->Me.ComboBoxName = Null
hth
Dp0756
Thanks again. Appreciate your help.
pere_de_chipstick
Good luck with your project.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.