SubForm items not displaying

SubForm items not displaying

I have three tables: Student, Class and Booking.

Student:Booking is a 1:n relationship.
Class:Booking is also a 1:n relationship.

Both the Student and Class forms have a Bookings subform.
I have a script in the Student > On Create or Edit  > On Success event:
  1. for each item in Class_Bookings 
  2. {
  3.       item.Student = ID;
  4. }

Similarly I have a script in the Class > On Create or Edit  > On Success event:
  1. for each item in Student_Bookings 
  2. {
  3.       item.Class = ID;
  4. }
The behaviour I'm trying to achieve is this:

On a Student form I can create bookings for 1 or many classes, likewise on a Class form I can create a booking for 1 or many students. These bookings would be shown in the Bookings subform in both the Student or Class forms.

The problem is that if I create a booking from the Student form, it shows in the subform on the Student form, but not in the subform in the Class form. Vice versa also applies. When I check the Bookings report, I can see that the relevant records are being created, with both fields set to the correct values. 

I'm very confused, this doesn't seem to be logical behaviour?

Thanks for any help. I don't seem to be able to upload files as I'm still being moderated, but can provide demo if it helps.

JP