Full Version: Combo box refresh
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
sadamson
I have a form that uses a combo box to select a name. Various other information is obtained with the form. The problem that I'm having has to do with the fact that there are usually two repetittions of the form for the same person. I'd like for the user to be able to leave the previously selected name on the form and just tab past it to add the additional data. When the program was in Access 2003, in the form_insert event, I performed a requery of the form and this seem to work. But, under 2007, this will not work and the user is having to select the same name again in order for the combo box to react properly.

I've tried a requery on the control when it gets focus when the user tabs though the box, but this doesn't seem to work either.

Can someone suggest a work around to this problem?

So far the only thing that works is to re-select the name.
ScottGem
You can use something like this:

If MsgBox("are you adding info for the same person?",vbYesNo) = vbYes Then
lngPersonID = Me.cboPerson
DoCmd.Runcommand acCmdGoToNewRecord
Me.cboPerson = lngPersonID
End If

I'm not sure if the acCmdGoToNewRecord constant is correct, but this should give you the idea.
sadamson
Thanks you.

Whereas I couldn't get it to work exactly like you have it, I was able to get it to work.

S. Adamson
ScottGem
The idea was to give you enough direction to make a go of it. Glad you got it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.