How to update a Combo in Sub after Closing Related Form

D

doyle60

I use the code below (which works) to update a combo on the Main form
when I close a form related to the combo:

If IsOpen("EntryForm2") Then
Forms![Entryform2]![CategoryID].Requery
End If

I'm trying to edit it, however, to update a different combo box which
is actually on a sub of the main form.

I tried this:

If IsOpen("EntryForm2") Then
Forms![Componentsub]![ComType].Requery
End If

and this:

If IsOpen("EntryForm2") Then
[Componentsub].Form![ComType].Requery
End If

and this:

If IsOpen("EntryForm2") Then
[Componentsub].Forms![ComType].Requery
End If

and those with the first line changed from "EntryForm2" to
"Componentsub".

But none of these, and other things I tried, works. How do I do
this? Thanks,

Matt
 
J

Jack Leach

Try this:

Forms!Entryform2!Componentsub.Form!ComType.Requery

This should tell it to walk to the subform via the mainform, rather than
your attempts at referencing the subform alone.

hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 

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