S
Stephanie
Hi. I've use Nz(DSum... before, but I'm not sure how/if
to use it in this case.
I have
Dim strWhere As String
Dim curBucksNumber As Currency
Dim curITABucks As Currency
strWhere = "[ContactID] = " & Nz([ContactID], 0)
curBucksNumber = Nz(DSum("BucksNumber", "BucksMember",
strWhere), 0)
That all works and I understand on curBucksNumber that I
am looking for field BucksNumber in the BucksMember table
given a certain ContactID (that reflects my current
Contact). This is all easy since ContactID is in the
BucksMember table.
Now, I need to find the sum of another field as well, but
ContactID is not in the same table, it's 3 relationships
away. So I tried to use sql which I pasted sql into VB
and it wasn't pretty- couldn't get the syntax correct.
If I do get it right, can I use it in Nz(DSum) and what
would it look like? Or is there a better way
altogether? I appreciate the help and details are nice.
Thanks,
Stephanie
to use it in this case.
I have
Dim strWhere As String
Dim curBucksNumber As Currency
Dim curITABucks As Currency
strWhere = "[ContactID] = " & Nz([ContactID], 0)
curBucksNumber = Nz(DSum("BucksNumber", "BucksMember",
strWhere), 0)
That all works and I understand on curBucksNumber that I
am looking for field BucksNumber in the BucksMember table
given a certain ContactID (that reflects my current
Contact). This is all easy since ContactID is in the
BucksMember table.
Now, I need to find the sum of another field as well, but
ContactID is not in the same table, it's 3 relationships
away. So I tried to use sql which I pasted sql into VB
and it wasn't pretty- couldn't get the syntax correct.
If I do get it right, can I use it in Nz(DSum) and what
would it look like? Or is there a better way
altogether? I appreciate the help and details are nice.
Thanks,
Stephanie