populate a textbox from a dropdown box - InfoPath Dev
in

InfoPath Dev

populate a textbox from a dropdown box

Last post 01-27-2012 08:38 AM by markarmstrong. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-27-2012 01:17 AM

    populate a textbox from a dropdown box

    Ok so i'm new to this but i will try to describe as much as possible.

     My aim is to have a dropdown box with supplier names in, this is populated via an SQL query, also i want to display the supplier phone number from the same sql query in another textbox based on the supplier selection.

     In simple terms there is a dropdown box, you select the supplier and the phone number for that supplier then appears in a textbox.

     The only part i am struggling on is the display of the phone number, i can get the first phone number to show but that is it

     For example

    SQL data

    Supplier     Phone number 

    supplier A    1234

    supplier B    4567

    Supplier C    7891

    it doesnt matter which supplier i choose from the drop down it always returs 1234 as the phone number

    xdXDocument:GetDOM("Live$Vendor")/dfs:myFields/dfs:dataFields/d:Live_Vendor/@Phone_No_[xdXDocument:GetDOM("Live$Vendor")/dfs:myFields/dfs:dataFields/d:Live_Vendor/@Name = xdXDocument:get-DOM()/my:PurchaseOrder/my:FirstDetails/my:Supplier]

  • 01-27-2012 07:34 AM In reply to

    Re: populate a textbox from a dropdown box

    Is this a database bound form? (i.e. is the schema locked?)

    If not, then it sounds like you're doing everything correctly, though there may be an issue with the filter (which depends on the form schema). Is there another column besides Supplier that you could use to filter? Maybe an ID field?

     

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-27-2012 08:03 AM In reply to

    Re: populate a textbox from a dropdown box

    Hi -

    Can you try this instead?

    xdXDocument:GetDOM("Live$Vendor")/dfs:myFields/dfs:dataFields/d:Live_Vendor/@Phone_No_[../@Name = xdXDocument:get-DOM()/my:PurchaseOrder/my:FirstDetails/my:Supplier]

     

    Hilary Stoupa

  • 01-27-2012 08:38 AM In reply to

    Re: populate a textbox from a dropdown box

    i mangage to fix it with this using the timestamp to identify the field

    thanks anyway

    xdXDocument:GetDOM("Live$Vendor")/dfs:myFields/dfs:dataFields/d:Live_Vendor/@Phone_No_[../@timestamp = xdXDocument:get-DOM()/my:PurchaseOrder/my:FirstDetails/my:SupplierSelect]

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.