Have a problem with using DSum function when two tables are linked together.
The tables are linked by the ID field. Tables are Table1 and Table2 with respective fieldnames (ID, A, C, D) and (ID, B). Datatypes are (number, text, number, number) and (Autonumber, number)
The following function creates syntax errors.
Expr1: Val(DSum("D","Table1","A & B = '" & [Table1].[A] & [Table2]. & "' and C <= " & [Table1].[C]))
This is the data similar to what I want to generate (which I can if all the fields are in one table).
A……….B…………..C……..D………Expr1
1……….1………..2002….25………..25
1……….1………..2003….12………..37
1……….1………..2004….14………..51
1……….2………..2002….10………..10
1……….2………..2003….20………..30
1……….2………..2004….30………..60
1……….1………..2005….12………..63
What is wrong with the syntax, do I have any missing operators…can you use this function with linked tables
Thanks in advance
The tables are linked by the ID field. Tables are Table1 and Table2 with respective fieldnames (ID, A, C, D) and (ID, B). Datatypes are (number, text, number, number) and (Autonumber, number)
The following function creates syntax errors.
Expr1: Val(DSum("D","Table1","A & B = '" & [Table1].[A] & [Table2]. & "' and C <= " & [Table1].[C]))
This is the data similar to what I want to generate (which I can if all the fields are in one table).
A……….B…………..C……..D………Expr1
1……….1………..2002….25………..25
1……….1………..2003….12………..37
1……….1………..2004….14………..51
1……….2………..2002….10………..10
1……….2………..2003….20………..30
1……….2………..2004….30………..60
1……….1………..2005….12………..63
What is wrong with the syntax, do I have any missing operators…can you use this function with linked tables
Thanks in advance