Link to home
Start Free TrialLog in
Avatar of ironpen45
ironpen45

asked on

combo box display in continuous form

Hello. I have a continuous form with unique records and I'd like to use a combo (dropdown) box to show related records from another table.

For the combo box, I have as ControlSource which works fine for each record on the continuous form:

=DFirst("[ProgramCode]","tblProgramCodes","[JobNumber]=" & [txtJobNumber])

To display, the rest of records, I have for RowSource:

select ProgramCode from tblProgramCodes where tblProgramCodes.JobNumber=txtJobNumber

The problem is that the combo box contents just shows the results of the RowSource for the top/first record and not the subsequent ones.

I can't remember if there is a trick to this.

Thanks!
Avatar of etech0
etech0
Flag of United States of America image

Is the value of the combobox going to be stored in the table that's behind this form? If so, you don't want to use DFirst.

I'm not sure what you're trying to accomplish here, but maybe you want a default value, rather than a control source!
Avatar of ironpen45
ironpen45

ASKER

I want to use the combo box to display related records instead of a subform.

In all, the continuous form will just display data, therefore it's non-editable/read only.
So which data do you want to display? How are the two tables linked? What do you want to show right away, and what do you want to come up in the combobox?
ASKER CERTIFIED SOLUTION
Avatar of Barry Cunney
Barry Cunney
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the tables are linked by JobNumber, and the continuous form will show the related records in the combo box as in:

select ProgramCode from tblProgramCodes where tblProgramCodes.JobNumber=txtJobNumber

again, the RowSource shows records only for the first/top record on the continuous form, and I need for it to differ from one parent record to another, for example:

JOBNUMBER   PROGRAMCODES (shown in combo box)

1                     2222
                       3333

2                     4444
                       5555
well, it's was a matter of requerying the combo box via FormCurrent event. thanks!