combo and text control behavior

T

Tom

I originally posted this message elsewhere, but haven't yet resolved
the issued. This post contains some additional information and a more
descriptive Subject line.

I have a continuous form (frm1) with a combobox. Rowsource for the
cbo is a lookup table with 2 fields (chID and chName).

Intent is to select an item from the cbo and have it displayed in the
cbo with the second field from the look up table displayed in a text
box (txtName) on the form.

Recordsource for the form is an inner join between the main table and
the lookup table with all of the main table fields and chName.

The working table only stores the chID value - not chName, since I can
always look that up.

So I would expect that when I select an item in the cbo, txtName would
immediately display the corresponding chName value. In fact I have
another subform in the database that references the lookup table in
the same manner and it works as I would expect.

However, that's not happening with frm1. If I close and reopen frm1,
txtName will fill in as expected. If I put me.requery in the cbo's
afterupdate, txtName fills in (but thats undesirable since it changes
the active record). But if I just move off the dirty record txtName
stays blank.

Someone has suggested Me.txtName = cbo.Column(1) in the
cbo_AfterUpdate. That doesn't work since the controlsource for
txtName is the lookup table field chName - Access throws an error.
I've also had a suggestion to shift to a datasheet view. That doesn't
work nor does it fit with my interface design.

Why can I get the desired affect with a subform, but not a main form?
Is it something intrinsic about being a subform, or am I missing a
setting someplace? Any other ideas on getting txtName to fill in
after selecting a value in the cbo without requerying the form or
otherwise saving the record.


Thanks
 

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