Forums

This topic is locked

Dynamic Insert Statement for Dynamic Form

Posted 14 Jun 2004 21:12:43
1
has voted
14 Jun 2004 21:12:43 Mitchel Tendler posted:
Hi,

I'm creating a survey form that will have a maximum of 10 questions and the
answers will be in the form of radio buttons.

Not all of the questions will be displayed, each table row containing a
single question/answers will be wrapped in an IF THEN statement which will
be controlled by a recordset that pulls which questions should be displayed.

The problem is the INSERT command, if I hard code the INSERT command to
insert all the value of radio buttons for questions 1 through 10, it will
give an error when it does not find a specific radio button that was not in
the form because we did not include it on the survey.

So if the INSERT command says insert the values for radio button 1 through
10 and we only display questions 1 through 5 what do I do?

Help.

Mitch

When in doubt...reboot!

Replies

Replied 18 Jun 2004 14:57:53
18 Jun 2004 14:57:53 Simon Martin replied:
Just a thought, but could you simply hide the unwanted radio buttons in your IF statement and give a default value for them in the DMX server behaviour?

The INSERT then would not throw an error about the number of radio buttons and the user would not know about the hidden items so your default value would be used.

Rather than having lots of NULL's in your db you would have your default value (DFV) and you could filter out based on that - a kind of IS NOT NULL hack

Edited by - ganseki on 18 Jun 2004 14:59:36
Replied 18 Jun 2004 16:12:52
18 Jun 2004 16:12:52 Mitchel Tendler replied:
ganseki,

Great minds think alike, that is exactly what we ended up doing.

Mitch

When in doubt...reboot!

Reply to this topic