Updating Table that is source for a look-up field in a Form.

G

Guest

I suspect I am going about this the wrong way.

I have 2 tables: People and Families.
Each person in Table:people must be in one and only one Family.
While entering people through a form, I have a button to allow entering a
new family, if this person's family is not yet on the Table:Families.
When a new Family is entered using this button, it does not show in the
look-up based on Table:Families unless the Form:people is closed and reopened.

I assume Form:people not being updated when the table supporting the lookup
is and I need for force a refresh after update, but I can't figure out how.

Or more likely, I need to go about it some completely different way.
 
A

Allen Browne

Use the AfterUpdate event procedure of the form where familes are entered to
requery the combo on the other form, i.e.:
If AllForms("People").IsLoaded Then
Forms![People]![FamilyID].Requery
End If

You may want to do the Requery in the form's AfterDelConfirm as well.
 
G

Guest

Thanks. Works like a charm!

Allen Browne said:
Use the AfterUpdate event procedure of the form where familes are entered to
requery the combo on the other form, i.e.:
If AllForms("People").IsLoaded Then
Forms![People]![FamilyID].Requery
End If

You may want to do the Requery in the form's AfterDelConfirm as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

StephenLegh said:
I suspect I am going about this the wrong way.

I have 2 tables: People and Families.
Each person in Table:people must be in one and only one Family.
While entering people through a form, I have a button to allow entering a
new family, if this person's family is not yet on the Table:Families.
When a new Family is entered using this button, it does not show in the
look-up based on Table:Families unless the Form:people is closed and
reopened.

I assume Form:people not being updated when the table supporting the
lookup
is and I need for force a refresh after update, but I can't figure out
how.

Or more likely, I need to go about it some completely different way.
 

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

Top