Change ComboBox RecordSource on Continuous Forms

  • Thread starter Thread starter James McNellis
  • Start date Start date
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.
 
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
 
Use the same Event (ComboBoxInFormHeader_AfterUpdate) to change or requery
the RowSource of the ComboBoxInFormDetail section.
 
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.
 
Thanks Van. That's what I was looking for.

I appreciate the help!

Cheers--

James.
 
Back
Top