A
Alp Bekisoglu
Hi All,
Can someone please help me out on this one? I'd like to correctly place the
following SQL in VBA code:
SELECT TOP 1 q_txable_s.person_id, q_txable_s.asessment_year, [2002].from,
[2002].to, [2002].first, [2002].next, [2002].tax, [2002].rate
FROM 2002, q_txable_s
WHERE ((([2002].from)<[q_txable_s]![Taxable_s]) AND
([q_txable_s]![Taxable_s]<=[2002]![to]));
where I'd like to use the following as well as the resulting code(open to
suggestions, advice,opinion):
Dim tNm, sSQL As String
tNm = Forms!yr!cur_y 'cur_y is a textbox on form yr
'below is where I need guidance in achieving the correct sytax, punctuation
'as can be seen, I'm trying to replace the table name with the tNm variable
sSQL = SELECT TOP 1 q_txable_s.person_id, q_txable_s.asessment_year,
tNm.from, tNm.to, tNm.first, tNm.next, tNm.tax, tNm.rate
FROM tNm, q_txable_s
WHERE (((tNm.from)<[q_txable_s]![Taxable_s]) AND
([q_txable_s]![Taxable_s]<=tNm![to]));
I thank everyone in advance for any guidance.
Sincerely,
Alp
Can someone please help me out on this one? I'd like to correctly place the
following SQL in VBA code:
SELECT TOP 1 q_txable_s.person_id, q_txable_s.asessment_year, [2002].from,
[2002].to, [2002].first, [2002].next, [2002].tax, [2002].rate
FROM 2002, q_txable_s
WHERE ((([2002].from)<[q_txable_s]![Taxable_s]) AND
([q_txable_s]![Taxable_s]<=[2002]![to]));
where I'd like to use the following as well as the resulting code(open to
suggestions, advice,opinion):
Dim tNm, sSQL As String
tNm = Forms!yr!cur_y 'cur_y is a textbox on form yr
'below is where I need guidance in achieving the correct sytax, punctuation
'as can be seen, I'm trying to replace the table name with the tNm variable
sSQL = SELECT TOP 1 q_txable_s.person_id, q_txable_s.asessment_year,
tNm.from, tNm.to, tNm.first, tNm.next, tNm.tax, tNm.rate
FROM tNm, q_txable_s
WHERE (((tNm.from)<[q_txable_s]![Taxable_s]) AND
([q_txable_s]![Taxable_s]<=tNm![to]));
I thank everyone in advance for any guidance.
Sincerely,
Alp