HowTo: Prefill a text box in a repeating table originating from a

L

Lidschi

Hi Newsgroup,

I have the following problem. I have a repeating table coming from a
database connection that looks like this:
Month ==> Year ==> Day ==> Category ==> Hours ...
Since this is a Timesheet people should not have to insert 31x January or
2005. Is it possible to set the value of 30 text boxes based on the value
that I enter in the first text box? Or is there any other way to predefine
the value of the check box based on month and year? Any suggestions?

Thank you very much in advance for your help.

Regards
Lidschi.
 
A

Andrew Watt [MVP - InfoPath]

Hi Newsgroup,

I have the following problem. I have a repeating table coming from a
database connection that looks like this:
Month ==> Year ==> Day ==> Category ==> Hours ...
Since this is a Timesheet people should not have to insert 31x January or
2005. Is it possible to set the value of 30 text boxes based on the value
that I enter in the first text box? Or is there any other way to predefine
the value of the check box based on month and year? Any suggestions?

Thank you very much in advance for your help.

Regards
Lidschi.

One of the functions available for text boxes is "today". If users
fill out the timesheet on the "right" day, that should do what you
want.

If you use that, think carefully about whether you want that to update
or not if the form is opened at a later date for editing, for example.

Otherwise I think you would have to code it.

Andrew Watt
MVP - InfoPath
 
A

Andrew Watt [MVP - InfoPath]

One of the functions available for text boxes is "today". If users
fill out the timesheet on the "right" day, that should do what you
want.

If you use that, think carefully about whether you want that to update
or not if the form is opened at a later date for editing, for example.

Otherwise I think you would have to code it.

Andrew Watt
MVP - InfoPath

Actually, after a second mug of coffee, you don't need code at all.

In the text box, right click and select Text Box Properties. Click the
fx button to add a formula for the default value. Select the Edit
XPath check box. Enter the formula:
.../ ../*[1]/*[1]

This assumes that the date is the leftmost (first) form control in a
row in a repeating table.

Once the user has entered a first value the others should work. I have
tested it just now with text and dates and it works nicely for me.

Andrew Watt
MVP - InfoPath
 

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