I would like to add 2 new records into a subform whenever a new record is created in the main form.
Ideally, I would also like to autofill some fields in those new records based on data entered into 2 fields of the main form (but I realise this may be a little too adventurous!).
The main form will have a date field entered and a day/night field set. I would like to use that information to autofill the start and end fields (in dd/mm/yy hh:nn format) of the subform as follows...
If day is set on main form:
I think I need to use VBA to achieve this, and from reading around I think I need to use the AfterInsert event for the first, and AfterUpdate for the second?
If anybody could provide any pointers for me to try I would be very grateful.
Ideally, I would also like to autofill some fields in those new records based on data entered into 2 fields of the main form (but I realise this may be a little too adventurous!).
The main form will have a date field entered and a day/night field set. I would like to use that information to autofill the start and end fields (in dd/mm/yy hh:nn format) of the subform as follows...
If day is set on main form:
- Subform start field = date 10:00
- Subform end field = date 22:00
- Subform start field = date 22:00
- Subform end field = date +1 day 10:00
I think I need to use VBA to achieve this, and from reading around I think I need to use the AfterInsert event for the first, and AfterUpdate for the second?
If anybody could provide any pointers for me to try I would be very grateful.