Hi guys…
I’m using Access 97 and am having a problem that I think I need to solve by somehow reinitializing either my form or a combo box. If I close the form and then re open it, then I have no problems.
My form starts with focus on an unbound control where I enter a part number. From there focus goes to a combo box where you enter a location (automatically filling in as you go), which is where the part resides in a warehouse. The query behind the combo box uses the value in the first control as partial criteria in the query, and the location in the combo box as the other. Works great until I get faced with the question at the end of the whole process that asks me if I want to relocate any more parts. Upon selecting yes, I use the following code:
DoCmd.Save
ctlPN.Value = “”
Combo30.Value = “”
ctlPN.SetFocus
The problem is that the combo box will not forget that previous list of locations that was used with the previous part number, unless I close and then reopen the form. If you click on the combo box, you see the list of locations that contain the previous part number only. I need a way to “flush it out” so that the new location, (which needs to also automatically fill in), does so.
I have tried using Me.Repaint, Me.Refresh, (‘Requery’ on the Not in List of the conbo box), Unload Forms![Relocate dual search], Load Forms![Relocate dual search] (doesn’t let me do the unload and load).
I know that there is probably a simple line of code to fix what is going wrong, but I’ve not been able to find it anywhere or figure out the answer.
Any ideas???
Thanks in advance
Chuck
I’m using Access 97 and am having a problem that I think I need to solve by somehow reinitializing either my form or a combo box. If I close the form and then re open it, then I have no problems.
My form starts with focus on an unbound control where I enter a part number. From there focus goes to a combo box where you enter a location (automatically filling in as you go), which is where the part resides in a warehouse. The query behind the combo box uses the value in the first control as partial criteria in the query, and the location in the combo box as the other. Works great until I get faced with the question at the end of the whole process that asks me if I want to relocate any more parts. Upon selecting yes, I use the following code:
DoCmd.Save
ctlPN.Value = “”
Combo30.Value = “”
ctlPN.SetFocus
The problem is that the combo box will not forget that previous list of locations that was used with the previous part number, unless I close and then reopen the form. If you click on the combo box, you see the list of locations that contain the previous part number only. I need a way to “flush it out” so that the new location, (which needs to also automatically fill in), does so.
I have tried using Me.Repaint, Me.Refresh, (‘Requery’ on the Not in List of the conbo box), Unload Forms![Relocate dual search], Load Forms![Relocate dual search] (doesn’t let me do the unload and load).
I know that there is probably a simple line of code to fix what is going wrong, but I’ve not been able to find it anywhere or figure out the answer.
Any ideas???
Thanks in advance
Chuck