Unload, Load?

chuckgoss

Registered User.
Local time
Today, 12:38
Joined
Mar 26, 2001
Messages
44
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
 
Try Combo30.Requery

or Combo30.RowSource = ""
 
Travis...thanks for the reply!

I had some luck with the Combo.RowSource = "" whereby it successfully got the drop down of the combo box to be blank, but still the query on the fly (as I type in a location), is missing. It doesn't see the part number at that location (I happen to know that there is a record that says that there is).

Might I be able to replace the "" of that code with the name of the query that I just nulled out? What might that code look like? The querys name is [test]. Perhaps,
Combo30.RowSource = Queries![test]? or am I way off base here?

chuck
 

Users who are viewing this thread

Back
Top Bottom