Data connection

N

Nilesh

I have created an INFOPATH form for employee leave records. This form is
connected with an access database. The access database is having the
following fields - sr. no (primary key), name, emp id, dept,from, to, type of
leave,no of days,status. From the infopath form, the employee will have input
the details for name (drop-down), emp id (text box), dept (drop-down), from
(date-picker), to (date-picker), type of leave (drop-down), no of days (text
box), Status is a read-only text box.
My question is : My boss told me that the 'no of days' should come
automatically from subtracting "to" and "from" fields. I know this question
has been asked a lot of times in this discussion group, however my problem is
unique. I don't want to make any changes in the database design nor the
form. I tried to make changes in the access database but was not successful
because we cannot enter a "datediff" formula in an access database table.
However, I was successful in entering a datediff formula in an access 'form'
which i created from the table. Now, the situation is that, whenever I query
from the Infopath form, I get the data from the access DB table and not the
access DB form. Thus, the 'no of days' column is showing '0'. Can i connect
IP form with a Access DB form ? Thank you for reading such a long
question.... :), but i really would appreciate help.
 
S

S.Y.M. Wong-A-Ton

No, it is not possible to connect an InfoPath form to an Access form.

If you change your mind about changing the structure of your form, you could
add a field to the form in the repeating table or section that shows all the
records, and write code in the OnSubmitRequest event to calculate the
difference between the dates and populate the difference fields. If you
choose this solution, you won't be changing the structure of your database,
neither the db fields added to your form by InfoPath. You would just be
adding a field to the main data source of your form to be able to display the
results of the calculation.

There aren't any codeless options available yet to get this done in InfoPath.
 
Top