Set value of Text Input Box but allow overwrite Follow

0
Avatar
Randall Everett

Hello,

I'd like to set the value of a Text Input Box so that value automatically shows in the box when the when the user clicks print or print preview. The user needs to be able to overwrite that value if necessary. I tinkered with Autocomplete but that doesn't seem to do what I had hoped. The Text Input Box in question will store a 4 digit year 3 years from the current year. I used the following while tinkering with Autocomplete and the script runs properly:

Value = Right("0" & Year(DateAdd("yyyy", 3, Date)),4)

Is there any way to have this value appear in the Text Input Box by default but allow the user to overwrite?

Thank you in advance,

Randall

1 comments

0
Avatar
Peter Thane

There is no need for VB for this.

Just add the field on with as a Date Field set to Clock, with the type as Date using a Custom YYYY format. In the Transforms add a Constant 3 year offset. 

On your Data Entry field add a Text Input box and link that to the above date field.

At print time the offset year will appear as default in the data entry box but the operators will be able to over-type this if required. 

Please sign in to leave a comment.