Refreshing a Form

  • Thread starter Thread starter Linda Ribbach
  • Start date Start date
L

Linda Ribbach

I have a dropdown box that uses data from a table called tblContacts. On the click event for the dropdown box, a form, in datasheet view, opens and allows the user to change a name or add a name to a table called ( tblContacts). When the Contacts form closes, I have a repaint object command in a Get Focus event.( I've tried it in the cbo and the form)

The results of this are: The preexisting data will show up in the drop down box as being changed, however any additions to the list will not show up until the form is closed and reopened.

How can I get the form to reflect all the changes (additions also)?

Thanks in advance Linda
 
In the AfterUpdate event procedure of the Contacts form, requery the combo
on the other form ("Form1" in this example):

Private Sub Form_AfterUpdate()
If IsLoaded("Form1") Then
Forms![Form1]![MyCombo].Requery
End If
End Sub

Copy the IsLoaded() function from the Utility Module in the Northwind sample
database.

You may want to do the same thing in the AfterDelConfirm event of the
Contacts form:

Private Sub Form_AfterDelConfirm(...
If Status = acDeleteOk And IsLoaded("Form1") Then
Forms![Form1]![MyCombo].Requery
End If
End Sub
 
Back
Top