Hi I have a form which I use to update a table. When I
add to the table through the form the form I return to on
completion the combo box does not show the record entered
on the previous form.
How can I get the cbo to requery shall I use the onclose
of the popup entry form and say that the main form should
now have focus then cbo.requery on the combo or shall i
use the ongotfocus of the main form to requery the cbos
each time it thinks it has just gained focus?
I hope you get me!!
Charles
The GotFocus event won't work. From the help topic 'GotFocus Event' ...
<begin quote>
A form can receive the focus only if it has no controls or if all visible
controls are disabled. If a form contains any visible, enabled controls, the
GotFocus event for the form doesn't occur.
</end quote>
The Activate event might work, but I have not tested that. I would use the
Close event of the popup form, as in your first suggestion. This is a
technique that I have used myself in similar circumstances ...
Forms("NameOfMainForm").Controls("NameOfComboBox").Requery

Signature
Brendan Reynolds (MVP)
> Hi I have a form which I use to update a table. When I
> add to the table through the form the form I return to on
[quoted text clipped - 10 lines]
>
> Charles