Re-synchronizing two combo boxes

G

Guest

I have a form (FormA) with a combo box (ComboA). The form has a subform
(FormB) with a combo box (ComboB). The choices that show up in ComboB are
determined by the selection in ComboA. This works fine, the first time. If,
after making a selection in ComboA and ComboB, you go back and change ComboA,
when you try to reselect ComboB it still shows the old list of choices, not
the new ones that should show up. How do I resynchronize ComboB with ComboA
after the ComboA selection is changed?
 
N

news.microsoft.com

insert this code on the on_got_focus event:

Me.ComboB.Requery

make sure that your datasource is filtered on the ComboA value

Cheers,

Jerico
 
G

Guest

That gives me the same error, "Microsoft Access can't find the macro
'Me.'" What do I need to do to make Access recognize this command? Do I need
a new version? I'm currently running Office 2000.
 
G

Guest

OK, I figured it out. In the combo box ComboA under On Change, I created a
procedure as follows:


Private Sub ComboA_Change()

Forms![FormA]![FormB]![ComboB].Requery

End Sub


This does exactly what I needed; everytime ComboA on FormA is updated,
ComboB on subform FormB automatically updates to match.

Thanks to those who tried to help.
 

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


Top