Update lookup query in subform

  • Thread starter Thread starter Fipp
  • Start date Start date
F

Fipp

I have a form called 'player' on that form there is a sub form called
'classschedulesubfrm' inside the subform there is a lookup field that runs a
query on the 'classes' table.

on the main form 'player' I enter a persons class schedule if there is a
class that is not in the database I click a button and the form 'classesfrm'
opens and I add the class that is missing, close the form and then try to
drop down the box in the 'lookupclass' control running the query to the
classestbl and the newly entered data doesn't show up yet?

I have tried to requery the data many different ways but haven't had success
yet. I am sure it is an easy answer.
 
Try putting a requery in the on enter event of the combo.
Me.ComboName.Requery
That will force the combo to fetch all the records from the table used to
build its rowsource.

Jeanette Cunningham
 
In the AfterUpdate event procedure of the classesfrm form, requery the combo
if the other form is open.

This kind of thing:

Private Sub Form_AfterUpdate
If CurrentProject.AllForms("player").IsLoaded Then
Forms!player!classschedulesubfrm.Form!lookupclass.Requery
End If
End If

You may want to do that in Form_AfterDelConfirm as well.
 
Fipp said:
the subform is a datasheet, does that matter?

A subform in Datasheet view would be fine.

A subdatasheet won't have the power you need. Use a real subform.
 
Back
Top