Dont have time to read your code but this works find for me. Its on
the close button of the form. I wonder if you problem is because of
the unload event 0 never used that one 0 maybe try on close.
'Test if the frmNewDataRequest form is open. if it is then refresh
the contact
'Combo box to include the newly added record
If CurrentProject.AllForms("frmNewDataRequest").IsLoa ded Then
Forms!frmNewDataRequest![cmboContact].Requery
End If
Have fun
Lincoln
lucinda.roebuck@ncmail.net (Lucinda Roebuck) wrote in message news:<a2d0500a.0409291101.7c6ce14b@posting.google. com>...[color=blue]
> I'm using Access 97 on a Windows XP computer. The combo box on the
> form "form1" will not refresh after a new name is added to the list.
> The "limit to list" properties for the combo box is set to yes. When
> I type a clients name in the box that is not in the list, the form
> "Add New Client Form" opens to add the client. When I return to the
> main form, the combo box will not refresh until I click on a name in
> the box and then click the refresh button, then I have to go back and
> change the name in the combo box to the correct one. This is the code
> I'm using the following event procedure for "On Unload" for the form
> "Add New Client Form". What is missing? I'd appreciate any help!
>
> Private Sub Form_Unload(Cancel As Integer)
>
> Dim MyControl As Control
>
> ' If Daysheet Form (Edit Mode) is loaded, then do following:
> If IsLoaded("form1 (Edit Mode)") Then
>
> ' Requery Client Name combo box, and set value of
> ' Client Name combo box.
> Set MyControl = Forms![form1 (Edit Mode)]![cbName]
> DoCmd.SelectObject A_FORM, "form1 (Edit Mode)"
> MyControl.Requery
>
>
> End If
>
> ' If Daysheet Form is loaded, then do following:
> If IsLoaded("form1") Then
>
> ' Requery Client Name combo box, and set value of
> ' Client Name combo box.
> Set MyControl = Forms![form1]![cbName]
> DoCmd.SelectObject A_FORM, "form1"
>
>
> End If
>
> End Sub[/color]