Dynamic Drop Down Menu from an Access Database

Hello Everyone,
I am user Adobe Designer 7 to create a fillable PDF, and I would like to get the options for a drop down menu from my MS Access database. Basically I would like to populate the drop down menu with the names in the Access database. There i Have a table called PhoneNumbers and it contains the names of all the people I want to appear in the drop down menu that I just created.
This is what I did:
I created a drop down menu and then I clicked on Object > Binding > under "Default Binding (Open, Save, Submit)" choose "New Data Connection"
then connect to the database using a fileDSN. I opened the table where with the "names" column (PhoneNumbers)
and under the "Query," option, I wrote:
select * from PhoneNumbers
Then it gave me all the fields from the table and I dragged the "Last name" field over the drop down menu. I will need to find a way to get the "First Name" field to join the Last Name field to create one name that looks like this: Hill, Angie
The problem is that even though it shows the name from the Access database, it does not give me a list of all the names when I open the form in Reader 7...
No matter how much I click that drop down arrow, the name does not change...
It's almost as if it gets to the databse and gets the data from the database, but it cannot loop through it...
It's almost as if it's missing the code to loop through it...
Why is this? Any ideas how to fix it so it gives me a list of ALL the names, when I click on the drop down button?
After that, how can I add the first name to it?
The form would look like this:
Angie H. 202 641 2055
Right now it does look like that, but I cannot change to another name when I click the drop down menu. For the code to be working when I change to another name, the phone number also changes to the phone number of that person:
Barry S. 703 555 1258
The name is in a drop down menu, the phone number is in a textbox.
Can you help me with this?

ANGELA,<br /><br />Well, the good new is that you are not far off...What you need is to insert the following code using Java Script under the Initialize function.  Just replace the Connection name,  The Hidden Value, and the Display Text with your information.  This is a function is 8.0 but will work with 7.0<br /><br />/*     This dropdown list object will populate two columns with data from a data connection.<br /><br />     sDataConnectionName - name of the data connection to get the data from.  Note the data connection will appear in the Data View.<br />     sColHiddenValue      - this is the hidden value column of the dropdown.  Specify the table column name used for populating.<br />     sColDisplayText          - this is the display text column of the dropdown.  Specify the table column name used for populating.<br /><br />     These variables must be assigned for this script to run correctly.  Replace <value> with the correct value.<br />*/     <br /><br />var sDataConnectionName = "DataConnection";     //     example - var sDataConnectionName = "MyDataConnection";<br />var sColHiddenValue = "CAT_Corp_SeqNo";               //     example - var sColHiddenValue = "MyIndexValue";<br />var sColDisplayText = "CAT_Corporate";               //     example - var sColDisplayText = "MyDescription"<br /><br />//     Search for sourceSet node which matchs the DataConnection name<br />var nIndex = 0;<br />while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)<br />     {<br />          nIndex++;<br />     }<br /><br />var oDB = xfa.sourceSet.nodes.item(nIndex);<br />oDB.open();<br />oDB.first();<br /><br />//     Search node with the class name "command"<br />var nDBIndex = 0;<br />while(oDB.nodes.item(nDBIndex).className != "command")<br />     {<br />          nDBIndex++;<br />     }<br /><br />//     Backup the original settings before assigning BOF and EOF to stay<br />var sBOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("bofAction");<br />var sEOFBackup = oDB.nodes.item(nDBIndex).query.recordSet.getAttribute("eofAction");<br /><br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");<br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");<br /><br />//     Clear the list<br />this.clearItems();<br /><br />//     Search for the record node with the matching Data Connection name<br />nIndex = 0;<br />while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)<br />     {<br />          nIndex++;<br />     }<br />var oRecord = xfa.record.nodes.item(nIndex);<br /><br />//     Find the value node<br />var oValueNode = null;<br />var oTextNode = null;<br />for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)<br />     {<br />          if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)<br />          {<br />               oValueNode = oRecord.nodes.item(nColIndex);<br />          }<br />          else if(oRecord.nodes.item(nColIndex).name == sColDisplayText)<br />     {<br />          oTextNode = oRecord.nodes.item(nColIndex);<br />     }<br />}<br /><br />while(!oDB.isEOF())<br />{<br />      this.addItem(oTextNode.value, oValueNode.value);<br />       oDB.next();<br />}<br /><br />//     Restore the original settings<br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sBOFBackup, "bofAction");<br />oDB.nodes.item(nDBIndex).query.recordSet.setAttribute(sEOFBackup, "eofAction");<br /><br />//     Close connection<br />oDB.close();

Similar Messages

  • Help needed with populating a drop-down list from an Access Database

    Topic
    data drop-down list
    Jason Murthy - 11:39am Feb 14, 2005 Pacific
    Hello,
    I am trying to use the data drop-down list from the custom library. I enter the name of my data connection and the other 2 variables in quotes when they are initialized, just like the example says to, but it still doesn't work. Anyone have any thoughts?
    Thanks,
    Jason
    Reply To This Discussion | Back to Topic List | Bookmark | Change Subscription
    To start a NEW discussion click on the Back to Topic List link and select Add Topic.
    If you are in an archive forum please go up to the main topic list (archives are read only).
    Messages 11 messages. Displaying 10 through 11.
    First Previous Next Last Show All Messages
    Denzil White - 5:46am Jul 28, 05 PST (#10 of 11)
    Oh and before you say anything more I have also tried changing it from Javascript to the FormCalc, and no diff, maybe I am more stupid than I realised, heh,heh
    Post Reply | Bookmark
    Henk Pisuisse - 12:06am Aug 9, 05 PST (#11 of 11)
    I am having trouble (sleepless nights) with populating a drop-down list from an Access Database. The result is: I only get the first record from the data connection. So the connection works but I cannot go through the other records. Maybe there is an other way to do this.
    I am trying to selectively fill a form with data from an MS-access database.
    I hope someone can help me.
    [email protected]
    The Netherlands (small country in Europe)

    If you email the access DB and the form to [email protected], I will try to take a look at it for you.

  • Dynamic Drop-Down Menu Solution

    Hi All,
    After spending a lot of time trying to find a good solution for a dynamic drop-down menu, I end up writing my own.
    The solution is for a list of items, having ITEM as the primary key of the table and ITEMDESCRIPTION as the list of options for the user to select.
    The steps are:
    1) JavaBean to return a ResultSet;
    2) A custom tag to build a HTML SELECT;
    3) A .tld file to declare the custom tag;
    4) web.xml where the custom tag mapping resides;
    4) A JSP to illustrate how to call the custom tag;
    Hoping this will save lots of time to others
    Cheers
    Trajano Roberto
    1) Custom tag
    package com.amstras.maintenance.customtags;
    * Title: erp
    * Description:
    * Copyright: Copyright (c) 2001
    * Company: amstras
    * @author Trajano Roberto
    * @version 1.0
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.jsp.*;
    import java.sql.*;
    import com.amstras.maintenance.javabeans.*;
    public class listitemmaster extends TagSupport {
    private itemmaster itemmaster = new itemmaster();
    private ResultSet rs = null;
    private String parametername = null;
    public int doStartTag() throws JspException {
    try {
    itemmaster.connect();
    rs = itemmaster.listitemmaster();
    pageContext.getOut().print( "<select name = \"" + parametername + "\">" );
    catch ( Exception e ) {
    throw new JspTagException( e.getMessage() );
    finally {
    return EVAL_BODY_INCLUDE;
    public int doAfterBody() throws JspException {
    try {
    if( rs.next() ) {
    pageContext.getOut().print( "<option value = \"" + rs.getString( "ITEM" ) + "\">" + rs.getString( "ITEM" ) + "&nbsp&nbsp&nbsp" + rs.getString( "ITEMDESCRIPTION" ) + "</option>" );
    return EVAL_BODY_AGAIN;
    else {
    pageContext.getOut().print( "</select>");
    itemmaster.disconnect();
    return SKIP_BODY;
    catch ( Exception e ) {
    throw new JspTagException( e.getMessage() );
    public void setParametername( String sPARAMETERNAME ) {
    parametername = sPARAMETERNAME;
    2) JavaBeam where the method to return the ResultSet resides
    public ResultSet listitemmaster() throws SQLException, Exception {
    if( con != null ) {
    try {
    String sSQL = null;
    sSQL = " SELECT ITEM, ITEMDESCRIPTION FROM ITEMMASTER ORDER BY ITEM ";
    ps = con.prepareStatement( sSQL );
    rs = ps.executeQuery();
    catch( SQLException sqle ) {
    error = "SQLException: list item master failed possible record does not exist. ";
    error += sqle.toString();
    throw new SQLException( error );
    catch( Exception e ) {
    error = "An exception occured while listing item master record. ";
    error += e.toString();
    throw new Exception( error );
    finally {
    return rs;
    else {
    error = "Exception: Connection to database was lost.";
    throw new Exception( error );
    3) extract from the .tld file where the custom tag is declared
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>itemmaster</short-name>
    <description>item master</description>
    <tag>
    <name>viewitemmaster</name>
    <tag-class>com.amstras.maintenance.customtags.viewitemmaster</tag-class>
    <attribute>
    <name>item</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <description>item</description>
    </attribute>
    </tag>
    <tag>
    <name>listitemmaster</name>
    <tag-class>com.amstras.maintenance.customtags.listitemmaster</tag-class>
    <attribute>
    <name>parametername</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <description>parameter name</description>
    </attribute>
    </tag>
    </taglib>
    4) web.xml mapping for the custom tag
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <servlet>
    <servlet-name>debugjsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
    <param-name>jspCompilerPlugin</param-name>
    <param-value>com.borland.jbuilder.webserverglue.tomcat.jsp.JasperSunJavaCompiler</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>debugjsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    </servlet-mapping>
    <taglib>
    <taglib-uri>erp/maintenance/itemmaster</taglib-uri>
    <taglib-location>/WEB-INF/itemmaster.tld</taglib-location>
    </taglib>
    </web-app>
    5) JSP call to the custom tag
    <%@ page errorPage="billofmaterialErrorPage.jsp" %>
    <%@ taglib prefix = "im" uri = "erp/maintenance/itemmaster" %>
    <html>
    <head>
    <title>CSI - ERP - add bill of material</title>
    <link rel = "stylesheet" href = "/erp/erpstyle.css">
    </head>
    <body>
    <h1>Add Bill of Material</h1>
    <form action = "billofmaterialcontroller.jsp" method="post">
    <table>
    <tr>
    <td align = "LEFT"><font color = blue>Parent Item:</font></td>
    <td><im:listitemmaster parametername = "parameter1" /></td>
    </tr>
    <tr>
    <td align = "LEFT"><font color = blue>Child Item:</font></td>
    <td><im:listitemmaster parametername = "parameter2" /></td>
    </tr>
    <tr>
    <td align = "LEFT"><font color = green>Qty Per:</font></td>
    <td><input type = "text" name = "parameter3" size = "5" maxlength = "5" /></td>
    </tr>
    </table>
    <p>
    <input type="submit" name="submit" value="Add">
    <input type="reset" value="Reset">
    </p>
    <input type = "hidden" name = "Action" value = "Add">
    </form>
    Click <a href = "billofmaterial.jsp">here</a> to go back.
    </body>
    </html>

    This is a very helpful execellent sample code.
    However, If I'm using Model-View-Control approach, then what's the way of applying these codes
    to each indivisual file? Say, I have 20 files and only 4 of the 20 need to be treated as they like
    to have drop down menu in particular column(s)??? How could the custom tag be applied as the
    controller tells the view to present these special treat? or it is not possible (I have to treat each
    file, filtered by controller -- one by one as it encounters the special need)?
    Thx, Tzae

  • --urgent Can I use table data to create a dynamic drop down menu?

    Hi,
    I am asked to investigate the possibility of using APEX to create a table driven dynamic drop down menu? The deadline is tomorrow but I have spent quite a bit of time but still have not any clue. Can any one have such experience to point me a way to focus on?
    Many thanks.
    Jennifer

    Thanks you very much for the help Kevin.
    Currently my company is using htp.p style to create web app and using the dynamic menu in a similar way as you explained. Now they want to move to Apex and still keep dynamic menu functionality. After reading your response and research I have done I think I can embed it into Apex application by creating the similar table and PL/SQL package and let Apex to call the PL/SQL package when the application is first called. However may I ask you a question about how to call such pl/sql procedure in Apex? .
    The current application has the following URL, from which the procedure pkg_main.print_menu is called and html home page with dynamic menu is displayed.
    Http://app server:1234/pls/applicationname/pkg_main.print_menu?p_new_window=N
    BUT what about the Apex? The Apex URL format is like the following, where 11563 and 1 is application id and page number. Assume that 1 is home page, but HOW the procedure is called, from WHERE?
    http://apex.oracle.com/pls/apex/f?p=11563:1:3397731373043366363
    Jennifer

  • How can I create a rollover drop down menu from a link in Dreamweaver CS5?

    Hello all,  I am working on a portfolio website and I was just wanting to know if there is any way that I can create a drop down menu from a text link that cascades once the cursor has made contact with the link. I would like to have it in my navigation bar where the Portfolio link is. Basically, my navigation bar looks like this : Home | Resume | Portfolio | Contact. I only want three items on the drop down menu beneath the portfolio link: Traditional Art, Photography, Graphic Design. I would really appreciate any help I can get! Thanks!

    Have a look at what Nancy does http://alt-web.com/DEMOS/CSS-Horiz-menu-2.shtml

  • Ichat drop down menu from menu bar shows up in the wrong place.

    I'm not sure how this happened, but for some reason, ever since I've moved to college, my Ichat drop down menu from the menu bar shows up on the left side of my screen, and you can only see half of the menu. I don't know how to fix this problem so if anyone could help me out that would be great.
    Sincerely,
    Cody Martin

    Yep.
    Go to the Buddy List Status Message and option the Edit option.
    Delete that Status Message that you have that is over 42 characters.
    Ones of about 60 or more will introduce the "Left Shift" (And the fact the drop Down may line up with the right hand edge of the Menu Bar icon on in-between lengths)
    In Snow Leopard it is possible to have a Long Message that displaces the Drop Down Off Screen.
    The other factor is the order of the Menu Bar Icons on that side of the Screen
    The iChat one can be Dragged if you use the Apple (CMD) key.
    If the Drop Down can not fit the message in before the right hand edge of the Screen it will displace.
    Having a Second mac User Account and deciding to Display which mac User is Logged in can give you some extra "space"
    3:24 PM Sunday; October 11, 2009

  • HT3819 I have turned two computers on to home sharing. I am now on this computer wanting to put my music on to this itunes and i know i need to find the other computer in the drop down menu from " Home Sharing " but that menu isnt there on the left?

    I have turned two computers on to home sharing. I am now on this computer wanting to put my music on to this itunes and i know i need to find the other computer in the drop down menu from " Home Sharing " but that menu isnt there on the left?

    If you have the horizontal menu bar showing (File, Edit, View,...), select View, then select Show Sidebar. 
    If the menu bar is not showing, dorp down the menu in the very upper left corner and select show menu bar, then follow steps above.
    Hope that helps.  Good luck.

  • How do I remove the autocomplete drop-down menu from textboxs, not the awesome bar?

    I like having the drop-down menu from the url, but the autocomplete option for textboxs within like when I type my username and it pops up with all of the ones that has been used on that site are really annoying. How do I get rid for the latter? I didn't have this before I upgraded to Firefox, and now I can't get rid of it. Fyi, I'm rather tech inept, don't use complicated comp sci words please!

    You can use History > 'Clear Recent History" to clear already saved form data.
    *https://support.mozilla.org/kb/Clear+Recent+History
    Use these steps to remove saved (form) data from a drop down list:
    #Click the (empty) input field on the web page to open the drop down list
    #Highlight an entry in the drop down list
    #Press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Deleting_autocomplete_entries
    See also "Prevent Firefox from automatically completing URLs":
    *https://support.mozilla.org/kb/search-your-bookmarks-history-and-tabs-awesome-bar

  • Utilizing Custom Tags to create a dynamic drop-down menu

    Hi to all,
    I am looking to create a dynamic .jsp to display to the user a drop-down list. This list is based upon data in database. The data will be passed as an application bean. This list will vary depending on application criteria.
    I would like to use a custom tag to create the drop-down menu. I am attempting to keep the .jsp page strictly .jsp, no Java. (I have been successful in creating & using an iterator tag.)
    Can someone point me in the right direction, or give me an example?
    thanks!
    Susie in Virginia Beach

    What exactly is it you don't know how to do? Write a custom tag or write database access code?

  • Drop down Menu from UNDER a banner?

    Here is an image of what I'm trying to create in Adobe Muse. I want the pictured drop down menu to appear to come from beneath the banner menu when you hover over the word "Accommodations".
    I got a response from a staff member that said this was possible using the "Tooltip Widget" and using a trigger on top of the banner. When I tried using this widget it was impossible to put the target and the tooltip trigger on different layers, or at least it was impossible for me to figure out how.
    Thus, the trigger for the dropdown had to be under the banner (and thus UNCLICKABLE) in order for the drop down to appear to be under the banner.
    Can someone please clarify whether or not this is possible using this program? Here is a link to the original discussion... http://forums.adobe.com/thread/1247488

    Hmmmm.... you may have to look at an alternative method to execute this concept. Take a look at Edge Animate Not only can you creat this type of menu, but you will also have a more dynamic and vibrant menu

  • Setting default value in dynamic drop-down menu

    Hi,
    I created a simple drop-down menu that can be used to edit an
    existing record or to create a new record.
    When creating a new record, I'd like the drop-down menu to
    display "Not specified" by default. Could anyone help me with this?
    The "Not specified" option in the drop-down menu should refer
    to record ID 11 in my database table entitled "names".
    Here's what my code looks like so far.
    The db queries:
    <CFQUERY DATASOURCE="DATA" NAME="get">
    SELECT *
    FROM names
    order by name
    </CFQUERY>
    <CFQUERY DATASOURCE="DATA" NAME="quo">
    SELECT *
    FROM quotes
    WHERE quoteID = #quoteID#
    </CFQUERY>
    This part is for the existing database record:
    <select name="frn_ID">
    <cfoutput query="get">
    <option value="#id#"<cfif id is quo.frn_ID>
    selected</cfif>>#name#</option>
    </cfoutput>
    </select>
    Here is where I'd like the ID with a default value of 11 to
    be displayed:
    <cfelse>
    <select name="frn_ID">
    <cfoutput query="get">
    <option value="#id#">#name#</option>
    </cfoutput>
    </select>
    </cfif>
    Thank you for any help with this!
    Luke

    Thank you.
    I added this line:
    <CFSET ThisOne = 11>
    and then edited the drop-down menu to appear like this:
    <select name="frn_ID">
    <cfoutput query="get">
    <option value="#id#" <cfif ThisOne is ID>
    selected</cfif>>#name#</option>
    </cfoutput>
    </select>

  • Populating a Drop Down menu from a EJB

    Hi,
    I have a scenario where the the user clicks on the one of the links on Page A and then the page navigates to Page B. On the Page B a drop down menu appears. Now I have to implement such that the drop down menu has to be populated dynamically by values returned from the EJBs which will be called when the link on the Page A is clicked.
    Can any one giude me as to how to do this.
    Thanks in Advance. !!

    Just write code logic in the bean action method behind the commandLink accordingly?

  • How to make dynamical drop down menu?

    I am trying to make a drop down menu which is dynamical in dreamweaver? is there a way to do that? i am not good at programming.

    Here are links to a couple of tutorials for this:
    http://www.roscripts.com/Building_a_dynamic_drop_down_menu-216.html
    http://www.finalwebsites.com/tutorials/dynamic-navigation-list.php

  • How can I create a drop down menu from an array

    Hello all,
    I am attempting to create a subvi that allows the end user to add a part number to an .txt file, and assigns that part number a value than can be used to select one of two modes of communication to be used to write to a EEPROM.   I am using the "write key.vi" and the "read key.vi" to create and read the .txt file.  What I would like to do is is use "get section names.vi" to read all of the part numbers and dump them into a drop down menu after the end user generates the file using the subvi.
    I guess my question is how do I dump a 1D string array into a drop down menu.
    I have attached some semi-functional .vi's to give an idea of what i am attempting to do.
    Erik
    Attachments:
    FirsttryPN.vi ‏15 KB
    PNwrite.vi ‏16 KB

    Place a Ring control on your front panel, then create a property node on the block digram. You can wire the output array of "Get Section Names" to populate the Strings[ ] property of the Ring.
    Retrieve the specific string selected by the operator by wiring the Ring control to the Index Array function.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • TS5249 I'm connecting my Bose T1 mixer to GarageBand via a MAC air.  In the drop down menu from smart control, it shows no audio input. Any suggestions?

    I'm connecting my Bose T1 mixer to GarageBand via USB cable.  In the drop down menu under smart control, it does not recognize this input or any input.

    go to system preferences > sounds > select audio input

Maybe you are looking for