Time verification.

J

jefnert

I have created a timesheet form in Infopath 2007 based on an Access Database.
The time sheet form has a repeating section which includes start time and
end time for a certian activity.

I need to make sure that the employee doesn't enter overlaping or invalid
start and end times for each activity.

for example:
changed light bulbs from 8:00 am - 10:00 am
changed filters from 9:00 am - 10:00 am (this should be 11:00 am - 12:00 pm)
It should always be impossible for an entry to overlap with another or for
two entries to have the same times.

any help or previous post you can point me to would be great.

Thanks
 
S

Santhosh

Hi,
You can use these two data validation expressions to achieve this. Here
'my:group2' is repeating table group.
1. Set this data validation on Start time field (e.g.my:StartTime).
a. Go to text box properties and click Data validation button.
b. In Data validation window click add.
c. In first drop down box select ‘The expression’.
d. In the text box paste this expression
msxsl:string-compare(., ../preceding-sibling::my:group2[1]/my:EndTime) <= 0
e. Add a sceen tip or message you want.

2. In similar way set this data validation on End Time field (e.g.my:EndTime)
msxsl:string-compare(., ../my:StartTime) <= 0
 
J

jefnert

Thanks Santhosh for the help.

I am still having problems with validating the start time compared to the
end time on the previous repeating section. Here is the validation statement
I put in the begin_time field.

msxsl:string-compare(., ../preceding-sibling::my:tbl_Entry[1]/@end_time) <= 0

tbl_Entry is the bound name for the repeating section.
end_time is the data field I want to validate against if it is a repeating
section.

If I understand the logic on this statement it is saying If begin_time is <=
end_time of the previous section display this error message.

However I don't get an error message if I enter an invalid time in the
repeated section.

Thanks for your help.
Jeff

Santhosh said:
Hi,
You can use these two data validation expressions to achieve this. Here
'my:group2' is repeating table group.
1. Set this data validation on Start time field (e.g.my:StartTime).
a. Go to text box properties and click Data validation button.
b. In Data validation window click add.
c. In first drop down box select ‘The expression’.
d. In the text box paste this expression
msxsl:string-compare(., ../preceding-sibling::my:group2[1]/my:EndTime) <= 0
e. Add a sceen tip or message you want.

2. In similar way set this data validation on End Time field (e.g.my:EndTime)
msxsl:string-compare(., ../my:StartTime) <= 0


jefnert said:
I have created a timesheet form in Infopath 2007 based on an Access Database.
The time sheet form has a repeating section which includes start time and
end time for a certian activity.

I need to make sure that the employee doesn't enter overlaping or invalid
start and end times for each activity.

for example:
changed light bulbs from 8:00 am - 10:00 am
changed filters from 9:00 am - 10:00 am (this should be 11:00 am - 12:00 pm)
It should always be impossible for an entry to overlap with another or for
two entries to have the same times.

any help or previous post you can point me to would be great.

Thanks
 
S

Santhosh (GGK Tech)

Hi,

Use the following data validation on begin_time field.

msxsl:string-compare(., ../preceding-sibling::d:tbl_Entry[1]/@end_time) <= 0

--
Santhosh
http://www.ggktech.com



jefnert said:
Thanks Santhosh for the help.

I am still having problems with validating the start time compared to the
end time on the previous repeating section. Here is the validation statement
I put in the begin_time field.

msxsl:string-compare(., ../preceding-sibling::my:tbl_Entry[1]/@end_time) <= 0

tbl_Entry is the bound name for the repeating section.
end_time is the data field I want to validate against if it is a repeating
section.

If I understand the logic on this statement it is saying If begin_time is <=
end_time of the previous section display this error message.

However I don't get an error message if I enter an invalid time in the
repeated section.

Thanks for your help.
Jeff

Santhosh said:
Hi,
You can use these two data validation expressions to achieve this. Here
'my:group2' is repeating table group.
1. Set this data validation on Start time field (e.g.my:StartTime).
a. Go to text box properties and click Data validation button.
b. In Data validation window click add.
c. In first drop down box select ‘The expression’.
d. In the text box paste this expression
msxsl:string-compare(., ../preceding-sibling::my:group2[1]/my:EndTime) <= 0
e. Add a sceen tip or message you want.

2. In similar way set this data validation on End Time field (e.g.my:EndTime)
msxsl:string-compare(., ../my:StartTime) <= 0


jefnert said:
I have created a timesheet form in Infopath 2007 based on an Access Database.
The time sheet form has a repeating section which includes start time and
end time for a certian activity.

I need to make sure that the employee doesn't enter overlaping or invalid
start and end times for each activity.

for example:
changed light bulbs from 8:00 am - 10:00 am
changed filters from 9:00 am - 10:00 am (this should be 11:00 am - 12:00 pm)
It should always be impossible for an entry to overlap with another or for
two entries to have the same times.

any help or previous post you can point me to would be great.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top