Page 1 of 1
Determining Coupling status using VBA
#1
Posted 20 January 2011 - 03:02 PM
Hi Everyone,
I am doing a project for work and I am working on setting up an automated spreadsheet for T1 season. I am updating certain client information to match our time and billing database.
I have been able to successfully populate data in a single return as well as a coupled return.
However I cannot tell if the return is coupled or not, if I manually type in the a file name that I know is for a coupled return then I can update information.
I would like to know which fields dictate coupling status.
Thanks for your help - great product!
Gerry
I am doing a project for work and I am working on setting up an automated spreadsheet for T1 season. I am updating certain client information to match our time and billing database.
I have been able to successfully populate data in a single return as well as a coupled return.
However I cannot tell if the return is coupled or not, if I manually type in the a file name that I know is for a coupled return then I can update information.
I would like to know which fields dictate coupling status.
Thanks for your help - great product!
Gerry
#2
Posted 21 January 2011 - 03:33 PM
I think I have it figured out!
If the form for the spouses T1 results in an error, then there is no coupled spouse.
T1FileObj.Client.FormCount("spouse.T1")
Please let me know if there are any other fields that you can advise me about.
Thanks in advance.
Gerry
If the form for the spouses T1 results in an error, then there is no coupled spouse.
T1FileObj.Client.FormCount("spouse.T1")
Please let me know if there are any other fields that you can advise me about.
Thanks in advance.
Gerry
#3
Posted 21 January 2011 - 04:53 PM
Hi Gerry. I've tried your suggestion in a script I've been working but I keep getting an "invalid form name" error. I would assume this line is supposed to return an integer answer but it doesn't seem to do that for me. Is there something I'm missing?
Thanks
Thanks
#4
Posted 21 January 2011 - 05:58 PM
dunner, on 21 January 2011 - 11:53 AM, said:
Hi Gerry. I've tried your suggestion in a script I've been working but I keep getting an "invalid form name" error. I would assume this line is supposed to return an integer answer but it doesn't seem to do that for me. Is there something I'm missing?
Thanks
Thanks
This is what I used, the T1Client is set, sorry I should have shown that above:
On Error GoTo NoSpouse
'Get the client object of the file
Set T1Client = T1FileObj.Client
T1Client.FormCount("spouse.T1") = T1Client.FormCount("spouse.T1")
#8
Posted 21 January 2011 - 09:50 PM
Ok... another approach (although I wish the powers that be at intuit could sign in ;) )
If you search any field that would be automatically created - eg a tax caclulation field, and the result is zero, the spouse is not coupled or does not exist.
eg. .client.field("spouse.line300") for the client it is 10,382, if no spouse exists it is 0. however this is problematic since the basic amount may be nil in some cases.
However the there is a .spouse.field available as well... unfortunately any time I try... no matter what I try I cannot get that to do anything but a runtime error.
The .client.addspouse.field works, but if the spouse does not exist it adds a coupled return - Which is great in my case since I used that field (.client.addspouse) to generate 200 dummy returns to practice with.
Unfortunately I am at a loss - there should be a simple solution, but I cannot find one, so I will have to find a form field that I am sure no one would ever overwrite and use that to tell if the spouse file.
If you search any field that would be automatically created - eg a tax caclulation field, and the result is zero, the spouse is not coupled or does not exist.
eg. .client.field("spouse.line300") for the client it is 10,382, if no spouse exists it is 0. however this is problematic since the basic amount may be nil in some cases.
However the there is a .spouse.field available as well... unfortunately any time I try... no matter what I try I cannot get that to do anything but a runtime error.
The .client.addspouse.field works, but if the spouse does not exist it adds a coupled return - Which is great in my case since I used that field (.client.addspouse) to generate 200 dummy returns to practice with.
Unfortunately I am at a loss - there should be a simple solution, but I cannot find one, so I will have to find a form field that I am sure no one would ever overwrite and use that to tell if the spouse file.
#9
Posted 21 January 2011 - 10:05 PM
So far the best field to determine if the spouse exists is client.field["spouse.t1info.b[10]"]. This is the marital status field if the spouse does not exist it is 0, which is not one of the other choices.
This may be the best approach. But I am all ears to any other suggestions! ;)
Have a great weekend.
Gerry
This may be the best approach. But I am all ears to any other suggestions! ;)
Have a great weekend.
Gerry
#10
Posted 21 January 2011 - 10:06 PM
Here's how I've checked for the existence of a spouse's tax return
If ((ThisClient.Field("t1info.b[10]") = 1 Or ThisClient.Field("t1info.b[10]") = 2) And _
ThisClient.Field("spouse.t1.s[1]") <> "") Then
This checks to see if the client is married or common-law and then the last part checks to see if there is something in the field for the spouse's first name on the T1. There wouldn't (as far as I can think) be a case where the spouse would have a return but no first name completed.
Hope that works for you.
Kevin
If ((ThisClient.Field("t1info.b[10]") = 1 Or ThisClient.Field("t1info.b[10]") = 2) And _
ThisClient.Field("spouse.t1.s[1]") <> "") Then
This checks to see if the client is married or common-law and then the last part checks to see if there is something in the field for the spouse's first name on the T1. There wouldn't (as far as I can think) be a case where the spouse would have a return but no first name completed.
Hope that works for you.
Kevin
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