B
Bruce
I have a form with a subform. The subform has a combo box
for Part Number. The problem comes when I attempt to
enter a part number that is not on the list. In that case
I would like to direct the user to a form for entering a
new part number. When that is done, I would like to
return to the original form/subform and select the part
number from the list.
I have attempted this in two ways. First, I used a
message box at the combo box's Not In List event. My
limited knowledge of message box code only allows me to
use the message box to direct the user toward another
action such as clicking a command button. If I could use
the message box to open the Parts form (to add a new
part), that would probably work, but I can't figure it out.
Second attempt was to set the Not In List event to open
the Parts form directly, or to open a form that allows the
user to either cancel or to open the Parts form. Sort of
a message box alternative. This led to the problem
described below, but by a shorter route than using the
message box.
Adding a new part by whatever method requires, I think,
requerying the combo box. However, attempting to do so by
means of code leads to an error message that I need to
save the record first. If I attempt to save the record,
that leads me back to the original Not In List event, and
I get stuck in a loop. How can I have the Not In List
event for a combo box allow the user to add to the list,
then to select from the revised list?
for Part Number. The problem comes when I attempt to
enter a part number that is not on the list. In that case
I would like to direct the user to a form for entering a
new part number. When that is done, I would like to
return to the original form/subform and select the part
number from the list.
I have attempted this in two ways. First, I used a
message box at the combo box's Not In List event. My
limited knowledge of message box code only allows me to
use the message box to direct the user toward another
action such as clicking a command button. If I could use
the message box to open the Parts form (to add a new
part), that would probably work, but I can't figure it out.
Second attempt was to set the Not In List event to open
the Parts form directly, or to open a form that allows the
user to either cancel or to open the Parts form. Sort of
a message box alternative. This led to the problem
described below, but by a shorter route than using the
message box.
Adding a new part by whatever method requires, I think,
requerying the combo box. However, attempting to do so by
means of code leads to an error message that I need to
save the record first. If I attempt to save the record,
that leads me back to the original Not In List event, and
I get stuck in a loop. How can I have the Not In List
event for a combo box allow the user to add to the list,
then to select from the revised list?