I'm using pass-through query code below on access. The code isn't a problem. My problem is to make a form on access that enters the varible on the place indicated and returns me the table from que SQL select. The regular solution: [Form]![Variable] doesn't work, because pass-through query doesn't support it I imagine (I'm not an Access expert). Does anyone have a solution for this problem?
SELECT instalacao
,tipounidade
FROM sgdprd.useccionadora us
INNER JOIN (
SELECT bloco
FROM sgdprd.redeprimaria rp
WHERE rp.useccionadora IS NOT NULL CONNECT BY rp.nox = PRIOR rp.fontex
AND rp.noy = PRIOR rp.fontey START
WITH rp.utransformadora = (
SELECT utransformadora
FROM sgdprd.redeprimaria rp
INNER JOIN sgdprd.consumidor con ON rp.utransformadora = con.instalacao
WHERE con.conta = '**VARIABLE GOES HERE**'
)
) lista ON lista.bloco = us.instalacao
WHERE us.tipounidade = 'DJ'
OR us.tipounidade = 'RL'