I am writing a VBA script in Excel that will write information from the Excel file to the T2125. I have no problem where the taxpayer and spouse only have one T2125. However, where the T1 file contains more than one T2125, how can you determine what # the current T2125 is? What I'm trying to get is the # of the T2125 that appears in the form tab.
Page 1 of 1
Determining T2125 # in VBA
#3
Posted 15 June 2010 - 04:40 PM
dunner, on 14 June 2010 - 10:48 PM, said:
I am writing a VBA script in Excel that will write information from the Excel file to the T2125. I have no problem where the taxpayer and spouse only have one T2125. However, where the T1 file contains more than one T2125, how can you determine what # the current T2125 is? What I'm trying to get is the # of the T2125 that appears in the form tab.
Hey Dunner, you can use the ClientObject.FormCount("insert form name as a string") property to figure out how many statements are there ... e.g. FormCount("T2125") will tell you how many T2125's there are. You would then access all of the field codes by subtracting 1 from the result. If there is 1 T2125 statement, the field code for that statement will be [0,x]; if there are two T2125's, the second statement's field codes would be [1,x] and so on...
The number that appears in the top of the form will match the FormCount property.
Hope that helps!
Dave
Page 1 of 1


Please remember this is a user-to-user community that relies on member participation. We encourage you to ask questions AND share your own thoughts, experience and advice.


MultiQuote