Combo boxes on continuous forms

J

Joan Edington

Hi,

I've been wading around the various sources of Access information for
a couple of days now and can't find an answer to my problem. That in
itsself makes me think that I'm missing something very simple, as
usual.

I am using Access 97 (sorry, but that's all I'm provided with at work)
and have a table with so little information in it that I thought a
continuous form with 1 line for each record entered would be ideal.

However, I am having a problem with a combo box on the record line.
This is the setup:-

Lookup Tables
-------------------------------
Organisations
---------------------
OrgID Number
Org Text

Offices
-----------
OffID Number
Office Text
OrgID Number

Staff Entry Form
-------------------------
Name Text
Org Combo Box lookup to Organisations
(bound to ID, displays text)
Office Combo Box lookup to Offices for organisation
(bound to ID, displays text, filters on OrgID)
Phone Text


If I have a form that displays a single record my combo boxes work
fine but not with the continuous form, 1 record per line.

What happens is that it always assumes the organisation from the
current line and only allows those choices for Office. This is all
very well for the record I am pointing at but all the other records in
the list for different organisations are displayed as blank rather
than their existing values.

Is there some way that the combo box choices can only be refreshed for
the current line rather than all lines?

I'd be very gratefull for any help on this one since it hardly seems
worth taking a full form for such a small single entry.

Joan
 
F

Fredg

Joan,
That is the expected behavior of any control that is not bound to a field.
If you wish to have each record in the continuous form display it's field
value, you must set the control source of the combo box to it's field in the
underlying table.
 
M

Mark A. Sam

Joan,

I didn't take the time to read over your table describtions, but I think I
know what you mean. The only way to handle this is to place a text box over
the combo with the controlsource property as an expression, =[FieldName]

where [FieldName] is the field that the combo is bound to. In the OnEnter
event of that textbox, place an expression to set focus to the compbobox,
like:

[MyCombo].SetFocus.

This is how I handle that and it works reasonable well.

God Bless,

Mark A. Sam
 

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

Top