Holidays Left Remaining using Submit.

D

Dave Harris

Hello all,

I am trying to achieve the following :

Use an Infopath form to fill out a holiday request. When the user enters
the amount of days they want to go away for, the Form will automatically
show the user the amount of holiday remaining.

When the SUBMIT button is pressed, it will take away the amount of days
requested from the Total amount of holiday days left and display this info.

All this info is stored in a SQL Server.

I am not clear as to whether the SUBMIT button can actually update records
in the SQL Table. If it can, I would really like to know how this can be
achieved.

Many thanks,

Dave Harris
 
S

Scott L. Heim [MSFT]

Hi Dave,

When you enable Submit functionality in InfoPath, this will automatically
perform the insert, update, delete, etc. when you click the Submit option.
However, it is not going to execute a calculation for you. This is the same
as manually entering data into SQL Server: that act does not execute
calculations - you typically use a stored procedure for that functionality.

From within InfoPath you can execute a stored procedure - we have a
Knowledge Base article on this topic:

How to work with stored procedures by using script in an Office InfoPath
2003 form
http://support.microsoft.com/default.aspx?scid=KB;EN-US;827007

So in short, what you will need to do create custom functionality to
execute the calculation and store that in the database...should that be
what you want to do.

The other option is to simply use either a text box or expression box in
InfoPath that performs the calculation. This would assume the InfoPath form
is keeping a running list of time off.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

Dave Harris

Thanks for this. Keeping the information in Infopath isn't really ideal. I
will "have a go" at the SP.

Incidentally, if I want to edit a field in a table do I have to write
specific "editing" code in the Submit button code?

Dave
 
S

Scott L. Heim [MSFT]

Hi Dave,

By "edit" I am assuming you mean edit data - if so, then no - the submit
functionality will automatically handle inserts, updates, deletes, etc.

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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