Update lookup query in subform

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.
 
J

Jeanette Cunningham

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
 
A

Allen Browne

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.
 
A

Allen Browne

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.
 

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