infopath vbscrip help

A

adchaz2

Hello All,

I am just starting to play with infopath. for my first project i need
to make a simple mortgage payment calculator in info path. I am having
trouble setting the document variable in my script. Any help will be
greatly appreciated.

Here is what i have so far

typical form with fiels for amount intrest etc and a scrip running on
button click

Sub CTRL6_5_OnClick(eventObj)

Set frmCalc = Document.vbmort2
price = frmCalc.Price.Value
dnpmt = frmCalc.DownPayment.Value
prin = price - dnPmt
intRate = (frmCalc.InterestRate.Value/100) / 12
term = frmCalc.Term.Value * 12
pmt = int((prin*intRate)/(1-(1+intRate)^(-1*term))*100)/100
frmCalc.Principle.Caption = prin
frmCalc.TotalPayments.Caption = term
frmCalc.Payment.Caption = pmt
End Sub

the main problem i have is that Set frmCalc = Document.vbmort2 errors
out saying Document and vbmort2 need to be defined.

What should i use for the defaul document/form?

thanks
 
A

Adam Harding

Hi

Try

SetfrmCalc = XDocument.DOM.selectSingleNode(vbmort2)

Hope this helps

Cheers Adam
 

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