Update a field - InfoPath Dev
in

InfoPath Dev

Update a field

Last post 04-01-2010 04:11 AM by Lawson71303. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-31-2010 06:05 AM

    Update a field

    Hi everybody,

    I have an IP 2003 form, and I would like to update the date and time with the "now" function in a textbox everytime a view is changed.

     Does anybody know the best way to do this?

     Thanks,

    -Lawson

  • 03-31-2010 11:02 PM In reply to

    Hi Lawson and welcome,

    I assume you mean update an expression box with Now every time someone changes a field on the current view. You'll need to add a rule to the root node in the main data source. In the InfoPath designer, go to Data Source and make sure Main is selected. Find the topmost group node underneath the root node. For forms created from scratch in InfoPath Designer, the myFields node is typically the root node. Double click on each child group nodes underneath it and go to Rules tab and add a rule with no condition that resets a field using the Now function. If you don't have group nodes but instead data nodes, you may need to rework your schema or add the same rule to those individual field nodes. The rule just sets the value of a field in the form that you use for the expression box that displays at the top of each view in the form. The value is Now().

    Happy trails!

    Patrick Halstead
    Project Manager at Qdabra
  • 04-01-2010 04:11 AM In reply to

    Thank you for the advice.

    This is actually a field within a data connection. The now () function will be used as part of the unique key. I have tried your suggestion many different ways. The only way I have been able to get this to work is by adding now () to the value f(x) box. This works, but only when the form is first created from the template. It does not update the now function. I need the now () function to be updated whenever the view is changed.

     I think that I need to open up the code and use the DateTime.Now.ToString with an onViewChange event...

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.