N
Nigel
I am trying to calculate some fields in a word form, the end result should be
that one field (Totalfee) is the total of 2 other fields (A1 + A2)
here is the code I am using
Sub Stalls()
Dim Message, Title, vstalls
Message = "Enter Number of Stalls required" ' Set prompt."
Title = "Stalls" ' Set title.
' Set default.
' Display message, title, and default value.
vstalls:
vstalls = InputBox(Message, Title)
On Error Resume Next
ActiveDocument.FormFields("Stalls").Result = vstalls
ActiveDocument.FormFields("stallcost").Result = vstalls * 45
ActiveDocument.FormFields("Facilities").Result = Stallcost + plugcost
ActiveDocument.FormFields("A2").Result = Facilities
ActiveDocument.FormFields("TotalFee").Result = A2+A1
End Sub
Sub plugins()
Dim Message, Title, vplugs
Message = "Enter Number of Plug Ins required" ' Set prompt."
Title = "Plug Ins" ' Set title.
' Set default.
' Display message, title, and default value.
vplugs:
vplugs = InputBox(Message, Title)
On Error Resume Next
ActiveDocument.FormFields("plug").Result = vplugs
ActiveDocument.FormFields("plugcost").Result = vplugs * 30
ActiveDocument.FormFields("Facilities").Result = Stallcost + plugcost
ActiveDocument.FormFields("A2").Result = Facilities
ActiveDocument.FormFields("TotalFee").Result = A2+A1
End Sub
Sub Fees()
Dim Message, Title, vstalls
Message = "Enter Total Show Fees" ' Set prompt."
Title = "Show Fees" ' Set title.
' Set default.
' Display message, title, and default value.
vfees:
vfees = InputBox(Message, Title)
On Error Resume Next
ActiveDocument.FormFields("A1").Result = vfees
ActiveDocument.FormFields("TotalFee").Result = A1 + A2
End Sub
I cannot get it to do the totals - any suggestions?
Thanks in advance
that one field (Totalfee) is the total of 2 other fields (A1 + A2)
here is the code I am using
Sub Stalls()
Dim Message, Title, vstalls
Message = "Enter Number of Stalls required" ' Set prompt."
Title = "Stalls" ' Set title.
' Set default.
' Display message, title, and default value.
vstalls:
vstalls = InputBox(Message, Title)
On Error Resume Next
ActiveDocument.FormFields("Stalls").Result = vstalls
ActiveDocument.FormFields("stallcost").Result = vstalls * 45
ActiveDocument.FormFields("Facilities").Result = Stallcost + plugcost
ActiveDocument.FormFields("A2").Result = Facilities
ActiveDocument.FormFields("TotalFee").Result = A2+A1
End Sub
Sub plugins()
Dim Message, Title, vplugs
Message = "Enter Number of Plug Ins required" ' Set prompt."
Title = "Plug Ins" ' Set title.
' Set default.
' Display message, title, and default value.
vplugs:
vplugs = InputBox(Message, Title)
On Error Resume Next
ActiveDocument.FormFields("plug").Result = vplugs
ActiveDocument.FormFields("plugcost").Result = vplugs * 30
ActiveDocument.FormFields("Facilities").Result = Stallcost + plugcost
ActiveDocument.FormFields("A2").Result = Facilities
ActiveDocument.FormFields("TotalFee").Result = A2+A1
End Sub
Sub Fees()
Dim Message, Title, vstalls
Message = "Enter Total Show Fees" ' Set prompt."
Title = "Show Fees" ' Set title.
' Set default.
' Display message, title, and default value.
vfees:
vfees = InputBox(Message, Title)
On Error Resume Next
ActiveDocument.FormFields("A1").Result = vfees
ActiveDocument.FormFields("TotalFee").Result = A1 + A2
End Sub
I cannot get it to do the totals - any suggestions?
Thanks in advance