Combobox on Coninuous form.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to requery only the current record on a continuous form. When
I requery it now all of the forms requery showing blank combos where there is
actually a value.
 
James said:
Is there a way to requery only the current record on a continuous form. When
I requery it now all of the forms requery showing blank combos where there is
actually a value.


The dependent combo box on a continuous form is a common
problem. The issue is that there is only one combo box.
This means that the combo box's RowSource only applies to
the current record so the other records are unable to
display an unbound column. The combo box's Value is
correct, but since the value's related record is not in the
RowSource query, the display can't find what you want to see
in the box.

The general idea of the workaround is to place a text box
exactly on top of the text portion of the combo box. Then
the form's record source query needs to be modified to
include the data that the combo box is supposed to display
(join the combo's row source base table to the forms base
table). Then the text box can be bound to that field and
will display the desired value.

To prevent user confusion, the text box's GotFocus event
should be used to transfer control to the combo box by using
a line of code:
Me.thecombobox.SetFocus

If all this sounds like gobbledygook, post back with the
details of the combo box, its row source table/query and the
form's record source table/query.
 
Marsh,

You actually need two textboxes in the workaround in most cases. Since a
combobox usually has an ID field and a value field in its rowsource, the
form needs a hidden textbox to hold the ID field and the textbox you mention
to hold the value field. The recordsource of the form needs to be modified
to include both the ID field and the value field.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
PC said:
You actually need two textboxes in the workaround in most cases. Since a
combobox usually has an ID field and a value field in its rowsource, the
form needs a hidden textbox to hold the ID field and the textbox you mention
to hold the value field. The recordsource of the form needs to be modified
to include both the ID field and the value field.


A second text box is not needed Steve. The combo box is
already bound to the ID field, which is the foreign key from
the form's record source to the combo box's row source base
table.

The whole problem is that the dependent combo's bound
field's value has no corresponding record in the combo's
filtered row source, not that the ID value is missing.
 
Back
Top