Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Auto populating fields from MS access

Avatar

Level 2

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

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 10

I woudl need to see the form and DB in action. Can you send both to

LiveCycle8@gmail.com and I will have a look when I can.

Paul