Automatically forcing new related record in subform

  • Thread starter Thread starter hootyeah
  • Start date Start date
H

hootyeah

I am trying to setup a db that manages a rental operation. I have a
main form "Jobs" which includes the subform "JobRooms" - joined with a
one-to-many rel by the field "JobsID". Furthermore inside my "JobRooms"
subform I have another subform "JobTimings" joined by a one-to-many rel
by the field "JobRoomsID".

What I am wanting to happen is when I create a new record in my "Jobs"
form I would like to automatically create a default record in
"JobRooms" subform and "JobTimings" subform, but only after a record in
the form "Jobs" is created . This is required as I have a query that
includes field from "Jobs, JobRooms and JobTimings" that sorts ALL
JobTiming records by date, and hence if related records are not created
in the "JobRooms" and "JobTimings" tables then they will not show up in
the query. The auto-created records would have default values so they
have enough data to show up in the query.

Is there a procedure I can run once a record is created in the "Jobs"
form? I am a novice when it comes to code - I generally try to have the
wizards do all my hard work! I need clear instructions!

Many thanks
 
I dont think your design is a good one. I would not create the 'dummy'
records. I would modify your query. You can always do a LEFT join query to
include records from Jobs even if there are no related records in JobRooms
and JobTimings.

-Dorian
 
Back
Top