Expand my Community achievements bar.

Load Combo Box from MS Access

Avatar

Former Community Member
Me and a co-worker are trying to learn the Designer for a proof of concept (yes, that means newbies). We are currently struggling with loading a dropdown combo box from a table in an MS Access database. We have the connection set up and the field assigned to the control. It populates with the first record from the table, but clicking on the dropdown button does nothing. Is it only populating with one record? Is there a property on the control that is not allowing the list to expand?



I saw another thread in this forum on this topic and the last entry in the thread included the phrase "I GAVE UP" - not very encouraging. This functionality is a must-have and seems pretty basic.



Any advice?
7 Replies

Avatar

Former Community Member
You need to use script to do this. In Designer 7.1 there is a Data Drop-down list object in the custom objects that has the script already there for you, you just need to fill in the name of the data connection and the fields you are interested in.



Make sure you select the "Delayed Open" property when creating the data connection.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Thanks Chris. Works perfect. And thanks for the quick response. I'm sure we'll have lots more questions and it's good to know that the answers are there.



Any chance you're near the San Diego area? I've beed trying to set up some type of consulting meeting with an Adobe rep, but not having any luck so far. Do you make house calls?

Avatar

Former Community Member
Hehe, I'm only near the San Diego in my mind, the weather's nicer than up here in Canada :P



If you drop an email to dev_info@adobe.com and let them know what you're interested in, and what'd you like to get out of the meeting I'm sure they would be able to work with you to set you up with the right people.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I am working on a similar situation but using an MS Excel data source via ODBC. I've connected successfully to the table and field name and can display the first record only in the custom drop down list. When I try to select with the drop down arrown I get an error beep. I do have delayed-open set for the connection. Any ideas?



Richard

Avatar

Former Community Member
I have been trying this using a Data Drop-down List and I cannot get it work. I have a data connection set up and instead of selecting Table from the choice I used an SQL query to select only one column in the table. There are three lines in the script some of which are confusing to me.<br /><br />var sDataConnectionName = "DataConnection"; //I got this one. it was easy<br />var sColHiddenValue = "<value>";<br />var sColDisplayText = "<value>";<br /><br />The last two I'm really not sure what to put there. I tried putting the name of the table column in place of each of "<value>". but it doesn't work.<br /><br />What else do I need to do to get it to work?

Avatar

Former Community Member
You're most of the way there, from the sounds of it. The sColHiddenValue is the column name of the key for the table you're fetching rows from, and the sColDisplayText column name of that you want to display in the combo box.



So typically..






var sColHiddenValue = "id";

var sColDisplayText = "name";






Hope this helps..

--

Steve Tibbett

Adobe Systems

Avatar

Former Community Member
Thanks. That's a fairly good explanation of how this works. Yes this does help.