Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Auto populating fields from MS access

Avatar

Level 2

Could someone help me with this issue please?

I have linked a pdf form with access DB successfully but I’ve got a problem with it populating the fields.

Basically my objectives are: when the user selects a country the respective states should be displayed into two different drop-down lists. The user can select one state from the first drop-down list (where all respective states should be displayed) and then the user can select a second state from the second drop-down list (which should display all respective states minus the state selected in the first drop-down list)

The problem:

There are two countries (US and UK) with 4 states for US and 5 for the UK. So, if the user selects US the first drop-down list only displays 2 states out of the 4 that should be displayed. The second drop-down list displays the other 2. If the UK is selected, the first drop-down list will display 3 of the 5 states and the second drop-down list will display the other 2. So it seems to be splitting the states across the 2 drop-down lists.

Here is the code:

form1.#subform[0].ddlCity::exit - (JavaScript, client)

var oDataConn = xfa.sourceSet.DataConnectionCOUNTY.clone(1);

oDataConn.nodes.item(1).query.select.nodes.item(0).value = "SELECT * FROM COUNTIES WHERE CITY_ID = " + this.rawValue;

oDataConn.open();

ddlCounty.clearItems();

ddlCounty.rawValue = "";

Text1.clearItems();

Text1.rawValue = "";

while(!oDataConn.isEOF())

{

    ddlCounty.addItem(xfa.record.DataConnectionCOUNTY.NAME.value, xfa.record.DataConnectionCOUNTY.ID.value);

    oDataConn.next();

    Text1.addItem(xfa.record.DataConnectionCOUNTY.NAME.value, xfa.record.DataConnectionCOUNTY.ID.value);

    oDataConn.next();

}

oDataConn.close();

1 Reply

Avatar

Level 2

Could someone help me with this please!!