ChuckRobert
Board Regular
- Joined
- Feb 26, 2009
- Messages
- 64
I have a “Schedule Updates” subform to allow users to schedule future changes to a record on a specific date.
These future changes populate tbl_ScheduledUpdates
Simple Query qry_ScheduledUpdatesBase finds records <=Date() that now need to be changed.
Update Query qry_ScheduledUpdates transfers these updates to tbl_Personnel. Then a Delete Query clears that row from tbl_ScheduledUpdates
The process works great if all fields were completed on the “Schedule Updates” subform, but if any fields are left blank, that field in the tbl_Personnel record is deleted.
My goal is to make this work while only requiring the user to enter the effective date and the given field on the “Schedule Updates” subform set to change.
I have tried to work with the Update Query, with some variation of the following to keep a Null field on Update Query qry_ScheduledUpdates from deleting that field in the tbl_Personnel record, by changing the “Update To:” line to the following, but this has not worked.
IIf(IsNull([qry_ScheduledUpdatesBase].[SchUpdateShift]),[tbl_Personnel].[Shift],[qry_ScheduledUpdatesBase].[SchUpdateShift])
I’m losing faith that an Update Query can accommodate this task as a group. Does anyone have a suggestion to handle this? Perhaps a VBA loop that references qry_ScheduledUpdatesBase and only updates fields which are not Null?
These future changes populate tbl_ScheduledUpdates
Simple Query qry_ScheduledUpdatesBase finds records <=Date() that now need to be changed.
Update Query qry_ScheduledUpdates transfers these updates to tbl_Personnel. Then a Delete Query clears that row from tbl_ScheduledUpdates
The process works great if all fields were completed on the “Schedule Updates” subform, but if any fields are left blank, that field in the tbl_Personnel record is deleted.
My goal is to make this work while only requiring the user to enter the effective date and the given field on the “Schedule Updates” subform set to change.
I have tried to work with the Update Query, with some variation of the following to keep a Null field on Update Query qry_ScheduledUpdates from deleting that field in the tbl_Personnel record, by changing the “Update To:” line to the following, but this has not worked.
IIf(IsNull([qry_ScheduledUpdatesBase].[SchUpdateShift]),[tbl_Personnel].[Shift],[qry_ScheduledUpdatesBase].[SchUpdateShift])
I’m losing faith that an Update Query can accommodate this task as a group. Does anyone have a suggestion to handle this? Perhaps a VBA loop that references qry_ScheduledUpdatesBase and only updates fields which are not Null?