Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Forms, Access Databases and ASP Code


  • Please log in to reply

#1
Immortalarena

Immortalarena

    Member

  • Member
  • PipPipPip
  • 216 posts
I have been working on this site for a while now, and there are a few things that I will need to do that I am unsure of. The first is that I want the users instead of Registering, to take a survey, at the end of which they will have been registered. To do this I want to keep the Survey Data, and the User Data Separate. I have below the Form Page, and the Submission page, cutting out the name of the database for security reasons. I need the data from the form, on submission to go into 2 table fields, and it's giving me some trouble. Worst of all, I would like to reference the Users ID Number, userid, from the "Users" Table, into the "Survey" Tables field userid. Among the many errors, I'm thinking there is an easier way to do all this than what I have done. Help is greatly appreciated. Thanks!

Current viewing of this page can be found at the following address: http://mrmatt.dynali...et/default2.asp
Thanks again!

Form Page:
<!-- #include file="includes/header.asp"-->  <p align="center">&nbsp;<p align="center"><b><font size="4" color="#000000" face="Arial">The Board of Directors for Troop 101’s Alumni Association is   interested in your thoughts and ideas. Please take a few minutes and respond to our survey so that   we may be able to build a more dynamic organization. </font></b>  <p align="center">&nbsp;<p></p>  <form method="POST" action="functions/submitsurvey.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">  <div align="center">    <center>    <table border="2" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="392" background="images/wBG.jpg">      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">First Name:</font></td>        <td width="265">        <p align="center">        <font face="Arial">        <!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="2" --><input type="text" name="fname" size="36" tabindex="1"></font></td>      </tr>      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">Last Name:</font></td>        <td width="265">        <p align="center">        <font face="Arial">        <!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="3" --><input type="text" name="lname" size="36" tabindex="2"></font></td>      </tr>      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">E-Mail Address:</font></td>        <td width="265">        <p align="center">        <font face="Arial">        <!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="5" --><input type="text" name="email" size="36" tabindex="3"></font></td>      </tr>      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">Street</font></td>        <td width="265">        <p align="center">        <font face="Arial">        <input type="text" name="street" size="36" tabindex="4"></font></td>      </tr>      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">City, State &amp; Zip</font></td>        <td width="265">        <p align="center"><font face="Arial">        <input type="text" name="city" size="16" tabindex="5"><font color="#000000">,        </font>        <input type="text" name="state" size="2" tabindex="6" maxlength="2"><font color="#000000">        </font>        <input type="text" name="zip" size="7" tabindex="7" maxlength="5"></font></td>      </tr>      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">Phone Number:</font></td>        <td width="265">        <p align="center">        <font face="Arial">        <input type="text" name="phone" size="36" tabindex="8"></font></td>      </tr>      <tr>        <td width="122">        <p align="center"><font face="Arial" color="#000000">Cell Phone:</font></td>        <td width="265">        <p align="center">        <font face="Arial">        <input type="text" name="cellphone" size="36" tabindex="9"></font></td>      </tr>    </table>    </center>  </div>  <p align="center" style="margin-top: -1; margin-bottom: -1">  <font size="3" face="Arial" color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font>  </p>  <div align="center">    <center>    <table border="2" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="562" background="images/wBG.jpg">      <tr>        <td width="405"><font face="Arial" color="#000000">How often would you say you visit the Troop Website?</font></td>        <td width="152" align="center">        <font face="Arial">        <select size="1" name="webAttend" tabindex="10">        <option value="Often">Often</option>        <option value="Sometimes  ">Sometimes</option>        <option value="Rarely">Rarely</option>        </select></font></td>      </tr>      <tr>        <td width="405"><font face="Arial" color="#000000">Would you like to receive a         newsletter?</font></td>        <td width="152" align="center">        <font face="Arial">        <select size="1" name="mailings" tabindex="11">        <option value="Yes" selected>Yes</option>        <option value="No">No</option>        </select></font></td>      </tr>      <tr>        <td width="405"><font face="Arial" color="#000000">Would you prefer an actual mailing to         your house or an electronic version?</font></td>        <td width="152" align="center">        <font face="Arial">        <select size="1" name="mailingType" tabindex="12">        <option value="Electronic">Electronic</option>        <option value="Postal">Postal</option>        </select></font></td>      </tr>      <tr>        <td width="557" colspan="2"><font face="Arial" color="#000000">Would you be willing to         help?<br>        Our members are spread all over the world today, and in order to make         our programs successful people are needed. Please note how you may help:</font></td>      </tr>      <tr>        <td width="557" colspan="2">        <font face="Arial" color="#000000">        <textarea rows="7" name="helpWilling" cols="66" tabindex="13"></textarea></font></td>      </tr>    </table>    </center>  </div>  <p align="center" style="margin-top: -1; margin-bottom: -1">&nbsp;</p>  <div align="center">    <center>    <table border="2" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="562" background="images/wBG.jpg">      <tr>        <td colspan="2" width="554">        <p align="center"><font face="Arial" color="#000000">We are considering a list of annual         events to bring alumni together. Please indicate those that you think         you would attend by checking the box provided. All events would be located in and around the Warren,         Ohio area.</font></td>      </tr>      <tr>        <td width="455"><font color="#000000" face="Arial">Family Camp Outing with the troop (June)</font></td>        <td width="94">        <p align="center">        <font face="Arial">        <select size="1" name="famCamp" tabindex="14">        <option selected value="Yes">Yes</option>        <option value="No">No</option>        </select></font></td>      </tr>      <tr>        <td width="455"><font color="#000000" face="Arial">Golf outing (July/ August)</font></td>        <td width="94" align="center">        <select size="1" name="golfOuting" tabindex="15">        <option selected value="Yes">Yes</option>        <option value="No">No</option>        </select></td>      </tr>      <tr>        <td width="455"><font color="#000000" face="Arial">Holiday Party (Between Christmas and New Years)</font></td>        <td width="94" align="center">        <select size="1" name="holidayParty" tabindex="16">        <option selected value="Yes">Yes</option>        <option value="No">No</option>        </select></td>      </tr>      <tr>        <td width="455"><font color="#000000" face="Arial">Reunion event every 5 years</font></td>        <td width="94" align="center">        <select size="1" name="reunionFive" tabindex="17">        <option selected value="Yes">Yes</option>        <option value="No">No</option>        </select></td>      </tr>      <tr>        <td width="455"><font color="#000000" face="Arial">Reunion event every 10 Years</font></td>        <td width="94" align="center">        <select size="1" name="reunionTen" tabindex="18">        <option selected value="Yes">Yes</option>        <option value="No">No</option>        </select></td>      </tr>      <tr>        <td width="549" colspan="2">        <p align="left"><font color="#000000" face="Arial">Other - Please Specify: </font>        <font face="Arial">        <input type="text" name="otherEvents" size="57" tabindex="19"></font></td>      </tr>    </table>    </center>  </div>  <p align="center"><b><font face="Arial" color="#FFFFFF">As we look to network with past members we have also set up   this Alumni Directory, Please Specify a Password for this Directory.&nbsp; You   will be contacted by Mail when your account has been activated by the   Administrator to prevent Spam</font></b></p>  <p align="center"><font face="Arial" color="#FFFFFF"><b>Password: <input type="password" name="password" size="20"></b></font></p>  <p align="center"><font face="Arial"><input type="submit" value="Submit" name="B1"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;  </font> <input type="reset" value="Reset" name="B2"></font></p></form><!-- #include file="includes/footer.asp"-->
Submission Page:

  • 0

Advertisements


#2
Immortalarena

Immortalarena

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 216 posts
Solved my problem.

Instead of trying to call each table separately I decided to try and call them together. When I call them together I am able to use this line:

strSQL = "SELECT users.*, survey.* FROM users INNER JOIN survey ON users.userid = survey.surveyUID;"

To call them both, and the line
INNER JOIN survey ON users.userid = survey.surveyUID
I am able to update the User ID of the users section to match the User ID on the survey table. Then I just had to add each form entry into the appropriate tables to finish off the code in 1 simple ADD section.

Thanks to all who looked at this over the past 24 hours. I can officially mark this task completed!

Thanks again!!! :)

Edited by Immortalarena, 15 April 2008 - 11:37 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP