B
BruceM
I have a continuous subform for selecting Part Number (PN). Each PN has a
description. The combo box (cboPN) for selecting PN has the Parts table
(tblPart) as its Row Source. Its autoexpand property is set to Yes. PartID
is the bound field; the next two columns are PN and Description. An unbound
text box (txtDescr) next to cboPN has as its Control Source:
=[cboPN].Column(2)
If the user enters a PN that is not in the list the Not In List event gives
them the opportunity to add a new Part. If they accept they are presented
with an input box for adding the Description. It all works as it should. I
hope this is enough explanation.
When I start to type the PN, autoexpand works as intended. txtDescr shows
the matching matching description as each new possibility appears in . This
is not a big deal, but if it is a new record the text box keeps showing the
latest possible value for the Description, even when the data entry has
reached the point where no parts match. For example, the PN I need to enter
is 123456. PN 1234 is a gear. PN 1111 is a flange. There is no PN 12345
or 123456. When I type the "1", "Flange" is shown in txtDescr, and remains
there until I get to "1234", at which time "Gear" is shown in txtDescr.
When I type "5" there are no more autoexpand suggestions, but txtDescr keeps
showing "Gear".
Users tend to find this confusing. They tell me that "123456" is a pulley,
but it keeps showing as "Gear". Is there a way to prevent this, maybe with
KeyPress code or something that clears txtDescr if there is no match? It is
a continuous form, so it is has been difficult finding an approach that does
not affect all records.
description. The combo box (cboPN) for selecting PN has the Parts table
(tblPart) as its Row Source. Its autoexpand property is set to Yes. PartID
is the bound field; the next two columns are PN and Description. An unbound
text box (txtDescr) next to cboPN has as its Control Source:
=[cboPN].Column(2)
If the user enters a PN that is not in the list the Not In List event gives
them the opportunity to add a new Part. If they accept they are presented
with an input box for adding the Description. It all works as it should. I
hope this is enough explanation.
When I start to type the PN, autoexpand works as intended. txtDescr shows
the matching matching description as each new possibility appears in . This
is not a big deal, but if it is a new record the text box keeps showing the
latest possible value for the Description, even when the data entry has
reached the point where no parts match. For example, the PN I need to enter
is 123456. PN 1234 is a gear. PN 1111 is a flange. There is no PN 12345
or 123456. When I type the "1", "Flange" is shown in txtDescr, and remains
there until I get to "1234", at which time "Gear" is shown in txtDescr.
When I type "5" there are no more autoexpand suggestions, but txtDescr keeps
showing "Gear".
Users tend to find this confusing. They tell me that "123456" is a pulley,
but it keeps showing as "Gear". Is there a way to prevent this, maybe with
KeyPress code or something that clears txtDescr if there is no match? It is
a continuous form, so it is has been difficult finding an approach that does
not affect all records.