views:

50

answers:

1

Hi everyone.

When I create a new command of a report that looks like that

select e.x, a.x, a.y
from Table1 t,
     table2 a
where a.z = e.z
  and a.xx = form1.ComboBox1.Text

it generates an error. Is there a way to do it?

Thanks

+1  A: 

Your columns need to have different names to each other - at present, the first two columns are both called x. Also, if your ComboBox has multiple values, you need to use an IN condition, not an =. Try changing the query to look like:

select e.x e_x, a.x a_x, a.y
from Table1 e,
     table2 a
where a.z = e.z
  and a.xx IN (form1.ComboBox1.Text)
Mark Bannister
That's my Query but it does not workselect e.Code_col, a.Niveau_att, a.Niveau_obs from Entretien e, App_comp_metier a where a.N_entretien = e.n_entretien and a.Comp_metier IN (Etat2.ComboBox2.Text)
Achraf
Does it generate an error?
Mark Bannister
yes:DataBase ConnectorError'DAO Error Code0*bf5 Source DAO.DataBase Description Trop peu de parametres.1 attendu
Achraf
That appears to be the same error as reported in the comments to the question. The message translates as "Too few parameters" - have any values been set in the ComboBox?
Mark Bannister