Change ComboBox RecordSource on Continuous Forms

J

James McNellis

Hello.

I have a form set up to display as continuous forms. It displays items from
a document.

I have a combo box in the header that lets a user select a version of the
document (basically, a filter). When you change the version, it changes the
rows displayed in the form. I have that working.

The detail of the form has a combo box in which I need to list different
items based on what revision is selected.

How do I change the combo box record source and update it on the fly?

Thanks in advance.

James.
 
S

Steve Schapel

James,

I think you are referring to the Row Source of the combobox, not Record
Source.

Probably the easiest way is to make a table which lists the Items and
associated Revisions, and then make a Query based on this table, with
the Criteria in the Revision column set to the equivalent of...
[Forms]![NameOfYourForm]![ComboboxInHeader]
On the AfterUpdate event of the combobox in the header, put code like
this...
Me.ComboboxInDetail.Requery
 
V

Van T. Dinh

Use the same Event (ComboBoxInFormHeader_AfterUpdate) to change or requery
the RowSource of the ComboBoxInFormDetail section.
 
J

James McNellis

Thanks Steve.

You're right, I did mean "Row Source".

My problem was actually that I had misspelled the name of a control. But
your answer pointed me to that because I didn't see the Requery method.

Thanks for your assistance.

Cheers--

James


Steve Schapel said:
James,

I think you are referring to the Row Source of the combobox, not Record
Source.

Probably the easiest way is to make a table which lists the Items and
associated Revisions, and then make a Query based on this table, with
the Criteria in the Revision column set to the equivalent of...
[Forms]![NameOfYourForm]![ComboboxInHeader]
On the AfterUpdate event of the combobox in the header, put code like
this...
Me.ComboboxInDetail.Requery

--
Steve Schapel, Microsoft Access MVP


James said:
Hello.

I have a form set up to display as continuous forms. It displays items from
a document.

I have a combo box in the header that lets a user select a version of the
document (basically, a filter). When you change the version, it changes the
rows displayed in the form. I have that working.

The detail of the form has a combo box in which I need to list different
items based on what revision is selected.

How do I change the combo box record source and update it on the fly?

Thanks in advance.

James.
 
J

James McNellis

Thanks Van. That's what I was looking for.

I appreciate the help!

Cheers--

James.
 

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