Primary data Source to store - Secondary Data source to retrieve

T

TJT

I am new to Infopath (still evaluating actually) and need to solve this
problem before we can proceed.

I have set up forms with an Access data source and am able to submit new
data and retrieve existing data. However, several fields such as customer
name, address, etc will already exist in another table and I'd like to spare
the user form having to re-type them in to my Main Data Source table.

I set-up the "lookup" table as a secondary data source, but how do I query
this data source and have it populate the appropriate fields that are bound
to my Main Data Source?

thanks for your help,
 
G

Greg Collins [InfoPath MVP]

Add a drop-down list box, bound to a field in the main DOM. Populate this list box with some data from your secondary data source. Add a set of rules to the drop-down list box which then populates the other fields based on the selection made.
 
T

TJT

Thanks Greg! I didn't think this was anything too difficult. Again, let me
apologize for my "ignorance", but I am assuming from your response that I can
populate the list box from my secondary source with more than 1 field,
correct? Actually, I need 4 fields from the secondary table.

And as for the set of rules to popluate the main data source fields on my
form, can you give me an example of the syntax? Is the rule placed on the
dropdown field or on the field being populated?

Thanks again,
 
G

Greg Collins [InfoPath MVP]

By "populate", what do you mean? If you mean for the display value to show a concatenation of values, you must manually edit your view .xsl file after extracting the form files (see File menu) and update the XSL to show something like:

concat(my:FirstName, " ", my:LastName)

If you are talking about the drop-down "storing" more than one value--this is not possible. That's what the rules are for. Once you make a selection, the rules get run and it is the rules that populate the other fields based on the selection made.
 
T

TJT

My secondary table would be somthing like this:

Customer#(unique), customer name, Effective Date, Thru Date

I want the Customer # to be the display value in the Drop-down list, this is
what the user types in, it is also the field that is bound to the Main Data
Source.

Then based on the number they enter, the other 3 fields (name and dates) get
entered into the appropriate fields on the form, again which are bound to the
main data source. I don't care if these fields are displayed in the dropdown
list. They only need to see the customer number.

I am having 2 problems.
One, when I try this.... nothing is displaying in the drop-down list and
Two, I don't know how to reference these other 3 fields in the Rules in
order to get them into the form fields.

Note, I am an Access developer and would do this by using the Column
property of the dropdown list.
Thanks, Greg
 
G

Greg Collins [InfoPath MVP]

Is your data connection set to query on load? Or have you forced your connection to query the database? If not, nothing will show.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top