Secret Squirrel said:
I forgot to mention that my continuous form is on a subform so when I run
the
wizard it won't let me select any fields from my subform.
Then, open up the sub-form in design mode....
So, you could open up the sub-form in design mode, and put the combo box
there?
Take a look at the code the combo box generates for a typical form.
The code for the combo box is quite simple. Assuming you build a combo box
that returns the 'id', but searchers by company name, in the after update
event, you could simply go
me.mysubform.form.RecordSet.FindFirst "id = " & me.MyComboBox
The above assumes that the table for the subform has a "id" as the primary
key (most tables do).
The more difficult problem here is actually building a combo box that
correctly loads the records that currently exists in the sub-form.
Your problem is not building the combo box (as above shows..it is about one
line of code). The problem here is LOADING the combo box with the given set
of records that the sub-form currently contains. If you are not restricting
records to the sub-form via the master/child settings, then you should be
able to open up the sub-form in design mode..and use the wizard to put a
combo box in the header.
If you are using the master/child settings of the main form to the sub-form,
then you going to have to load up the combo box in the main form (and, use
the forms on current event - and then use the above one line of syntax in
the combo box after update).