Hi All
I'm hoping someone can help me with some code to handle duplicate/conflicting entries. I am creating a resourcing database. Staff are scheduled for either AM, PM or All day for each date using a Form ("Resourcing"). The fields on the form are [Start_Date], [End_Date] and [Duration] (ALL Day, AM, PM). At the moment if I attempt to book someone All day for a date that is already populated it simply creates another entry with the same date in the table ("Resourcing").
Worse still I display the data using a crosstab ("2014 Resources"). Column 1 = Name, Collumn 2 shows Duration (AM, PM AND All Day). Work_Dates is the Column Header and Activity is the Value for the crosstab. When I create a duplicate value it doesn't even show on the crosstab.
What I am looking for is code to add to the form ("Resourcing") that checks the table ("Resourcing") and checks the following:
If there is an entry for All Day and the user tries to input anything then offer choice to amend details of present entry or discard this entry and open form ("Edit Hours")
If there is an entry for AM and the user enters an entry for PM continue
If there is an entry for AM and the user tries to enter AM or All day then offer choice to amend details of present entry or discard this entry and open form ("Edit Hours")
If there is an entry for PM and the user enters an entry for AM continue
If there is an entry for PM and the user tries to enter AM or All day then offer choice to amend details of present entry or discard this entry and open form ("Edit Hours")
Any help with this would be much appreciated.
Thanks
Guinness
I'm hoping someone can help me with some code to handle duplicate/conflicting entries. I am creating a resourcing database. Staff are scheduled for either AM, PM or All day for each date using a Form ("Resourcing"). The fields on the form are [Start_Date], [End_Date] and [Duration] (ALL Day, AM, PM). At the moment if I attempt to book someone All day for a date that is already populated it simply creates another entry with the same date in the table ("Resourcing").
Worse still I display the data using a crosstab ("2014 Resources"). Column 1 = Name, Collumn 2 shows Duration (AM, PM AND All Day). Work_Dates is the Column Header and Activity is the Value for the crosstab. When I create a duplicate value it doesn't even show on the crosstab.
What I am looking for is code to add to the form ("Resourcing") that checks the table ("Resourcing") and checks the following:
If there is an entry for All Day and the user tries to input anything then offer choice to amend details of present entry or discard this entry and open form ("Edit Hours")
If there is an entry for AM and the user enters an entry for PM continue
If there is an entry for AM and the user tries to enter AM or All day then offer choice to amend details of present entry or discard this entry and open form ("Edit Hours")
If there is an entry for PM and the user enters an entry for AM continue
If there is an entry for PM and the user tries to enter AM or All day then offer choice to amend details of present entry or discard this entry and open form ("Edit Hours")
Any help with this would be much appreciated.
Thanks
Guinness