REF field "Error! Not a valid bookmark self-reference."

A

Andre The Hunter

Hi,

I'm trying to create a bookmark that will modified under certain conditions.
Let me show you what I mean.

In the below example, I have a bookmark called year. Year is defined by user
input from an ASK field. I want to make it so that a user can enter the year
as the full yyyy or simply the two digit yy version.

{ IF { REF year } = "20*" "" "{ SET year "20{REF year}" }" }{REF year}

The final REF field produces a "Error! Not a valid bookmark self-reference."

The strange thing is that I've done similar things and it worked.
{ SET deposit "{ = { REF full_fee} / 2 }" }

Could it be because I'm referencing the bookmark I am setting?

I have searched the Internet, and although I found instances of the error in
other documents and converted PDFs, I could not find a description or
solution to this REF field error.

Any help is appreciated

Andre'
 
M

macropod

Hi Andre,

Try this:
{QUOTE{ASK Year}{IF{=Year}={REF Year} "{SET Year {IF{=INT(Year/1000)}> 0 {Year} {=MOD({=Year-1},100)+{IF{=MOD({=Year-1},100)+1}>
{DATE \@ YY} 1901 2001}}}}{Year}" "Data Entry Error"}}

I've gone beyond what you asked for, by adding a test to see whether the two-digit year is greater than the current two-digit year
(eg 97) and, if so, converting it to a year from last century. I've also added some error checking.

The bookmark you're after is conditionally set by:
{SET Year {IF{=INT(Year/1000)}> 0 {Year} {=MOD({=Year-1},100)+{IF{=MOD({=Year-1},100)+1}> {DATE \@ YY} 1901 2001}}}}

Cheers
 

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