View Full Version : Help with Subforms!!!


matt123
07-22-2001, 02:41 PM
HELP! I have inserted a Sub-Form the ID of the subform is related to a field in the Master form. When data is entered through the several fields and comes to the last field (before it should tab to the Sub-Form) I get and error message that reads "You cannot add or change a record becausea related record is required in table (where it mentions the underlying table of the subform). Anyone who can help is life saver.

Rich
07-22-2001, 03:11 PM
Last time I got that message the relationship was the wrong way around, check that.
HTH

matt123
07-22-2001, 03:18 PM
Dear Rich
I am sorry, but I dont understand that. Could you elaborate a little? Thanks for your help.
Matt

Pat Hartman
07-22-2001, 03:45 PM
Your relationship is one-to-many and you have used the "many" side table as the mainform recordsource and the "one" side as the subform's recordsource. These need to be reversed since you must enter data into the "one" side table before you can enter related records in the "many" side table. Take an Order and OrderDetails as an example. You must enter an order before you can enter any items related to that order.

matt123
07-22-2001, 04:31 PM
Thank you both! The lightbulb went on, and that was exactly what I needed to hear.