CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 On the fly form built from a query

Print topic Send  topic

Author Message
Steve1445

Posts: 16
Posted: 08/25/2006, 6:51 AM

Has anyone done this? I have a form that 35 people will use. Each person will answer 16 different questions depending upon thier job requirements. Instead of creating 35 forms that vary only by the questions asked, is it posible to have the user input thier name at the when they open the form. Then have a query tied to their name that will pull their 16 questions from a table and place them in the form for them to answer. Seems simple enough but I don't know where to start.
View profile  Send private message
Edd


Posts: 547
Posted: 08/26/2006, 6:27 PM

You can achieve this in a couple of ways and it does depend on your expertise.

Here is how I would approach it
1. Create a single form with all the questions as a single form - 1 question per row.
2. In each row's HTML put a wrapper around each question (Ensure that the BEGIN AND END cases and formatting is correct)
<!-- BEGIN Q01 -->
<tr>
<td>What is a duck?</td>
<td><input name="{duckname}" value="{duck}"></td>
</tr>
<!-- END Q01 -->

3. In the BeforeShow event for each question perform the following:
Dim Q01Block
Dim Q02Block
etc
' For each question attack each row
' Get the row
Set Q01Block = FormName.TemplateBlock.Block("Row").Block("Q01")
'Clear it
Q01Block .Clear

If AskDuckQuestion = true Then
' populate the values inside the block
duck = CCGetParam("duck",FormName.datasource.recordset.fields("duck"))

Q01Block .Variable("duck") = duck
' Tell CCS to process it
Q01Block .Parse ccsParseAccumulate
End If

Then continue for each question.


This should work - look up references on hiding rows.

Regards,
Edd

_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message
Steve
Posted: 08/28/2006, 1:00 PM

Thank you, as you said "it does depend on your expertise' I will have to stretch some to learn how to do this but that's the fun of it. Thank you for taking the time to answer my post. Steve
V
Posted: 11/26/2006, 10:57 PM

Steve, answer to your question:

-- first make an "employees" table with a list of employees...
i.e.
1 sam
2 peter
3 tom

-- second make a "questions" table with a list of questions.....
i.e.
1 question1
2 question2
3 question3

-- third make a "employee/questions" table and assign questions to which employee it belongs too...
i.e.
1 2
1 3
***1 means Sam
***2 n 3 means question 2 and 3 which means sam is assigned to answer questions 2 n 3

NOW you have a listing of employees with questions assigned to them.

-- create a user login and based on login get the user id in "Session"
-- create your form and populate questions based on user id...

i hope this helps:-)

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.