many to many relationship?

S

Steve Schapel

Justin,

At the risk of further teaching grandma to suck eggs... :)
The name of the subform control on the main form is not necessarily the
name of the form that it houses. Is "OrderDetails" the name of the form
used for the subform? Is it also the name of the subform control on the
main form? It is the name of the subform control on the main from that
has to be used in the code.
 
G

Guest

Hi Steve,
Your risky move the grandma something :D
I had to add a ProductID field to my SplitOrder table and a combo box to
re-select the product being split, for some reason it wouldn't pull it from
the orderdetails table. It works perfectly though.

Thanks a million Steve!
 
G

Guest

I got to thinking...and because the ProductID field is now in my SplitOrder
table...If the users make a mistake and put the wrong product(many similar
products are in my list) The code won't replace the existing one, because the
ID's won't match...

The reason I moved it was because it was giving me the related field
required...
Would a solution be to keep the ProductID field on my SplitOrder table but
make it get it's value automatically from the active record on the
OrderDetails subform?
Would this even be possible?
 
S

Steve Schapel

Justin,

There should be no need to put the ProductID in the SplitOrder table.
Obviously if there was a problem (which I don't quite understand what it
was - I don't understand "it was giving me the related field required"),
then the problem needs solving, but solving it by putting the ProductID
in the SplitOrder table does not seem like the best way.

The button that opens the SpitOrders form is on the Detail section of
the OrderDetails subform, right? The ProductID field is number data
type, right?

Anyway, if you decide to persevere with your solution, yes it is
possible for the required ProductID to be automatically inserted, based
on the ProductID of the current record in the OrderDetails subform.
Probably the simplest would be to set the Default Value property of the
ProductID control on the SplitOrders form to something like this...
=[Forms]![Orders]![OrderDetails]![ProductID]
 

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