calculations in infopath forms

L

LTAN

Hello everyone. Im not a pro at either Access or Infopath. Actually im a
newbie to these technologies. I have an infopath form where it requires to
have calculations on fees. can u help me how to do it in access then how to
connect it to infopath? my form is for training request. it should include
course code, course description, duration and course fee. my boss wants to
have something like a dropdown button that when u choose one it will
automatically reflect all the details about it especially its course fee, if
it has discounts it will automatically compute for it. thank you and any help
would be highly appreciated.
 
B

BhanuY/+919985103237

Hi,

You can use Rules for this
Right click on the dropdown and Goto Rules
Set the rules for all the values of the dropdown.
Hope this will helps
 
L

LTAN

hi BhanuY,

Thank you for your reply. Will it requires codes? What should i use? since,
i've only tried making connections using Add Actions under Rules and it
doesnt involve any programming. thanks again
 
S

Swathi

Hi,
I think it is better to use an XML file for your requirement which includes
the following data.
<Courses>
<Course>
<CourseCode>1</CourseCode>
<CourseDescription>CourseDescription1</CourseDescription>
<Duration>10</Duration>
<CourseFee>1000</CourseFee>
</Course>
<Course>
<CourseCode>2</CourseCode>
<CourseDescription>CourseDescription2</CourseDescription>
<Duration>20</Duration>
<CourseFee>2000</CourseFee>
</Course>
<Course>
<CourseCode>3</CourseCode>
<CourseDescription>CourseDescription3</CourseDescription>
<Duration>30</Duration>
<CourseFee>3000</CourseFee>
</Course>
</Courses>
Save this xml as “CourseDetails.xmlâ€.
Then upload this file in to the infopath form uisng the following steps.
1.Open the InfoPath form in design mode.
2.Go to Tools -> Data Connections. Click on Add button.
3.Select ‘Receive Data’ radio button. Click Next.
4.Select ‘XML Document’. Click Next.
5.Click on ‘Browse’ and select the ‘CourseDetails.xml’ file. Click ‘Next’
for twice. Then click finish.

Now design the InfoPath by taking 1 drop down and 3 text boxes.
1.Go to drop down list box properties by right clicking on that.
2.Select ‘Lookup values from external data source’.
3.Select ‘CourseCode’ in entries.
4.Put the rules for getting course description.
a.Go to ‘Rules’ in drop down list box properties.
b.Add a rule. Click on ’Add Action’ button.
c.‘Select a filed Value’ in ‘Action’ drop down.
d.Select ‘Course description field’ in ‘Field’.
e.Click on ‘Fx’ button in ‘Value’ field. Click on ‘Insert Field or Group’.
f.Select ‘CourseDetails’ in ‘data source’ drop down.
g.Select ‘CourseDescription’. Click on ‘FilterData’. Click ‘Add’ button.
h.Select CouseCode(From CourseDetails) is equal to ‘CourseCode’(From Main
data source).
i.Click ‘OK’ until all windows closed.
j.Repeat the steps b to I for getting Duration and CourseFee by just
changing the CourseDescription with the appropriate fields.
Hope this helps you.
 
L

LTAN

Hi Swathi,

Thank you very much for your time to answer back. I appreciate it a lot. my
problem now is im not familiar with XML. can u step me through how or where
can i write the codes you've provided. where should i write this codes?

<Courses>
<Course>
<CourseCode>1</CourseCode>
<CourseDescription>CourseDescription1</CourseDescription>
<Duration>10</Duration>
<CourseFee>1000</CourseFee>
</Course>
<Course>
<CourseCode>2</CourseCode>
<CourseDescription>CourseDescription2</CourseDescription>
<Duration>20</Duration>
<CourseFee>2000</CourseFee>
</Course>
<Course>
<CourseCode>3</CourseCode>
<CourseDescription>CourseDescription3</CourseDescription>
<Duration>30</Duration>
<CourseFee>3000</CourseFee>
</Course>
</Courses>

thank you again.
 
S

Swathi

Hi,
Open the 'Note pad'.
Copy the text which I sent.
Paste in the note pad.
Save that as 'CourseDetails.xml'.
 
L

LTAN

Hi Swathi,

thank you for guiding me. i have followed the steps but it doesnt work. when
i previewed the form and click the dropdown box, it has entries of 1,2,3. but
when i chose one of the entries, it doesnt show any details in the 3
textboxes (course description, duration, and course fee.) i assumed that if i
chose one of the entries it should also retrieve corresponding course
description, duration and course fee. is this supposed to happen? for example
course code: A1,
course description: Accountancy 1,
duration: 5 days,
course fee: 50,000.00.

course code: B1,
course description: Biology 1,
duration: 5 days,
course fee: 40,000.00.



i want to show all these details by just clicking/choosing A1 in the course
code (drop down). but if i chose A2, all details for A2 will be shown in the
form. thank you.
 
L

LTAN

course code: B1,
course description: Biology 1,
duration: 5 days,
course fee: 40,000.00.



i want to show all these details by just clicking/choosing A1 in the course
code (drop down). but if i chose A2, all details for A2 will be shown in the
form. thank you. I MEANT B1.






Hi Swathi,

thank you for guiding me. i have followed the steps but it doesnt work. when
i previewed the form and click the dropdown box, it has entries of 1,2,3. but
when i chose one of the entries, it doesnt show any details in the 3
textboxes (course description, duration, and course fee.) i assumed that if i
chose one of the entries it should also retrieve corresponding course
description, duration and course fee. is this supposed to happen? for example
course code: A1,
course description: Accountancy 1,
duration: 5 days,
course fee: 50,000.00.

course code: B1,
course description: Biology 1,
duration: 5 days,
course fee: 40,000.00.



i want to show all these details by just clicking/choosing A1 in the course
code (drop down). but if i chose A2, all details for A2 will be shown in the
form. thank you.
 
A

Anuma(GGK Tech)

Hi,

To understand my steps please Read secondary xml fields as: coursecode,
coursedescription, duration, coursefee.
And also Read form fields [Main Schema] as: coursecode1, coursedescription1,
duration1, coursefee1

Add the following rules to the coursecode1 dropdown
1. Select dropdown properties.
2. Select “rules†button and select Add button.
3. Select “Add Action†button from Rule window.
4. Select “set a Fields values†from Action dropdown.
5. Select “coursedescription1†in the field text box.
6. Select “courseDescription†field path.
7. Click Filter Data, and then click Add.
8. In the Specify Filter Conditions dialog box, select Select A Field Or
Group from the first drop-down list.
9. In the Select A Field Or Group dialog box, select “coursecodeâ€, and then
click OK.
10. In the second drop-down list, select Is Equal To.
11. In the third drop-down list box, select “coursecode1â€, and then click OK.

Follow from third step to add another two rules for duration and course fee
fields.

I hope this will help you.
 

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