Onload Client-side

Hello All,

I have a database and I want to show users a pop up if there are any negative responses to questions in the form.

I have a form that contains a subform depending on which subform is chosen. I have the onload functionality on the subform. (I have also tried it on the main form but the same thing happens)

When I load the form after inserting a negative answer the first response is picked up but it doesn’t notify about other negative responses.

Here is my code for onload

@If(

Radio2=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 2”);

Radio4=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 4”);

Radio5=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 5”);

Radio6=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 6”);

Radio7=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 7”);

Radio8=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 8”);

Radio9=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 9”);

Radio10=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 10”);

Radio11=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 11”);

Radio12=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 12”);

Radio13=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 13”);

Radio14=“Yes”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 14”);

Radio15=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 15”);

“”)

So it picks up that the first radio button has a no answer but not that the second one or any other subsequent ones. What do I need to do to get it to pick up all the negative answers in the database on opening?

Thanks in advance,

Laura

Subject: Onload Client-side

Laura,

Can you not put the code in the Input Validation of the fields??? Each would need to be split, which is probably why you are doing it this way

I would use individual @if statements to buidl a string variable and then have one prompt at the end if the string variable does not equal “”

eg

stringvar:=“”

@if(Radio1=“No”;stringvar=stringvar+“Question 1”+@char(0);“”)

@if(Radio2=“No”;stringvar=stringvar+“Question 2”+@char(0);“”)

@if(Radio3=“No”;stringvar=stringvar+“Question 3”+@char(0);“”)

@if(stringvar<>“”;@prompt([OK];“There were errors with the following questions…”+@char(0)+@char(0)+stringvar);“”)

HTH

Mike

Subject: RE: Onload Client-side

That’s because @If evaluates the statement associated with the first condition argument that’s true. You might instead write:

@If(Radio2=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 2”); “”);

@If(Radio4=“No”;@Prompt([Ok];“Error!”;“There is a non standard answer for question 4”); “”);

and so on.

Actually, though, this is not a very good user interface. If there are five wrong answers the user has to click five times to get past the messages. And to remember which questions had the wrong answers, they would have to take notes. I think it would be better to use Computed Text next to the questions to display some marker to show that an answer needs attention, e.g.:

Did you shoot anyone this week?

○ Yes ● No

Did you strangle anyone?

● Yes ○ No

r

Computed text formula: @If(Strangle=“Yes”; “r”; “”)

and use the Webdings font – just an example.