Advertisement

02.16.2007 at 11:56AM PST, ID: 22395019
[x]
Attachment Details

Need to pull ID from dropdown box to another table

Asked by ksilvoso in Active Server Pages (ASP), Microsoft Access Database, Access Forms

Tags: , ,

I have a form to add a new member to an organization and I need to assign him to a committee. I have a form to create and edit the committees, they are assigned a committeeID which at the moment is 1 thru 6. So the committee table just has committeeID and committeeName. In the other form members are added, I have some fields for name, phone etc and a dropdown box which is populated with the committeeNames from the table named committee. When I add a new member all the info is updated to the committeemembers table except for the committeeID. I need the committeeID that corresponds to the committeeName  that was selected from the dropdown box to be writen to he committeeID field in the committee table but it does not do that. This is what I have so far. This creates the dropdown populating it with the names from the committee table:

      dim rs, sqlstr, adoCon, htmlComm, rsC

      set adoCon = Server.CreateObject("ADODB.Connection")
      
      adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/fpdb/info.mdb")
      
      set rs = Server.CreateObject("ADODB.Recordset")
      set rsC = Server.CreateObject("ADODB.Recordset")
      
      sqlstr = "SELECT * FROM committeeMembers"
      sqlstrC = "SELECT committeeName FROM committee ORDER by committeeName DESC"
            
      rs.Open sqlstr, adoCon,3,3
      rsC.Open sqlstrC, adoCon,3,3
      
      htmlComm = ""
      htmlComm = htmlComm & "<select id=committeeID name=committeeID style='width: 300px;'>"
      do while not rsC.EOF
            htmlComm = htmlComm & "<option selected value=" & rsC(0) & ">" & rsC("committeeName") & "</option>" & vbCr
            rsC.movenext
      loop
      htmlComm = htmlComm & "</select>" & vbCr

This is the process page:

      set rs = Server.CreateObject("ADODB.Recordset")
      set rsC = Server.CreateObject("ADODB.Recordset")
            
      sqlstr = "SELECT * FROM committeeMembers"
      sqlstrC = "SELECT * FROM committee"
                  
      rs.Open sqlstr, adoCon,3,3
      rsC.Open sqlstrC, adoCon,3,3
            
      rs.AddNew
      committeeTitle = Request.Form("committeeTitle")
      committeeFname = Request.Form("committeeFname")
      committeeLname = Request.Form("committeeLname")
      committeeLocation = Request.Form("committeeLocation")
      committeePhone = Request.Form("committeePhone")
      sortorder = Request.Form("sortorder")
      committeeID = Request.Form("committeeID")

      rs.addNew
      rs("committeeTitle") = committeeTitle
      rs("committeeFname") = committeeFname
      rs("committeeLname") = committeeLname
      rs("committeeLocation") = committeeLocation
      rs("committeePhone") = committeePhone
      rs("sortorder") = sortorder      
      rs("committeeID") = committeeID
                                    
      rs.Update
      rs.Close


I am sure the problem is with how I am getting the committeeID from the dropdown box and passing it to the committeemembers table but I do not see the problem
Start Free Trial
[+][-]02.16.2007 at 12:26PM PST, ID: 18551635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.16.2007 at 06:54PM PST, ID: 18553688

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.16.2007 at 09:10PM PST, ID: 18553997

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2007 at 10:15AM PST, ID: 18555934

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2007 at 10:55AM PST, ID: 18556068

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2007 at 11:45AM PST, ID: 18556226

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2007 at 11:52AM PST, ID: 18556259

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.17.2007 at 03:10PM PST, ID: 18556847

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.17.2007 at 03:19PM PST, ID: 18556869

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Microsoft Access Database, Access Forms
Tags: assign, box, dropdown
Sign Up Now!
Solution Provided By: fritz_the_blank
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.17.2007 at 06:44PM PST, ID: 18557321

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.18.2007 at 10:09AM PST, ID: 18559137

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2007 at 07:32AM PST, ID: 18609727

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2007 at 12:01PM PST, ID: 18611889

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32