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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top