Update multiple records

  • Thread starter Thread starter Mick
  • Start date Start date
M

Mick

Hello,

What I want to do with a form is update multiple records
for Field 2 while keeping Field 1 the same. For example,
say I had [ToyType] and [Color]. I'd like to have a form
that would allow you to select Ball once for [ToyType] and
then be able to select multiple colors for the ball. So
the table would end up with...

Ball Red
Ball Green
Ball Yellow

and so on. What's the best way to accomplish this?

Thanks!!
 
One way is to have an unbound combo box for ToyType and
have the user select the type first. Then, have a
continuous form that only shows Color. On the
Form_BeforeInsert event, set the ToyType value (which is
not shown on the form) = to the ToyType combo value.

Me.ToyType = Me.cboToyType

You just have to be sure the user has selected a value in
the ToyType combo box before they can add a color row so
you don't get a database error.
 
Thanks Larry,

I've been working on this solution you gave me and its not
quite working. Here are a couple of more facts that may
help...

I don't want to be able to select ToyType, I want to be
able to add it, then be able to add multiple Colors for
the new ToyType. So if I enter Ball, everytime I add a
new color in a continuous form, Ball will come up in the
next record. To enter a new ToyType, I would simply close
the form out and open to a new record.

One more glitch I've run into...I tried setting up a form
as you said, but when I enter ToyType and try and move to
the subform Color, I get an error saying that Color is
required. Then it won't even let me move to the field to
enter info. I hope the way I'm explaining this makes
sense...
-----Original Message-----
One way is to have an unbound combo box for ToyType and
have the user select the type first. Then, have a
continuous form that only shows Color. On the
Form_BeforeInsert event, set the ToyType value (which is
not shown on the form) = to the ToyType combo value.

Me.ToyType = Me.cboToyType

You just have to be sure the user has selected a value in
the ToyType combo box before they can add a color row so
you don't get a database error.

-----Original Message-----
Hello,

What I want to do with a form is update multiple records
for Field 2 while keeping Field 1 the same. For example,
say I had [ToyType] and [Color]. I'd like to have a form
that would allow you to select Ball once for [ToyType] and
then be able to select multiple colors for the ball. So
the table would end up with...

Ball Red
Ball Green
Ball Yellow

and so on. What's the best way to accomplish this?

Thanks!!

.
.
 
Back
Top