Sorry ... hvis jeg ikke udtrykte mig klart nok, men kriterierne alene <> Between o.s.v. kender jeg udemærket, men når dette skal vælges via cbo... så virker det ikke
Skal benytte forespørgslen som datagrundlag i en formular, så der virker vist ikke
Hele foresprøgslen ser således ud ( hvis det er nogen hjælp )
SELECT tblKampagneFormål.[KampagneFormål tekst] AS Kampagneformål, Count(tblKampagneData.KampagneID) AS [# Kampagner], tblKampagneData.KampagneFormål FROM tblKampagneFormål INNER JOIN tblKampagneData ON tblKampagneFormål.KampagneFormål = tblKampagneData.KampagneFormål WHERE (((tblKampagneData.KampagneStørrelse) Like "*" & [Formularer]![frmAnalyseRapporter]![cboKampagnestørrelseValg] & "*") AND ((tblKampagneData.NaceBrancheID) Like "*" & [Formularer]![frmAnalyseRapporter]![cboBrancheValg] & "*") AND ((tblKampagneData.KampagneType) Like "*" & [Formularer]![frmAnalyseRapporter]![cboKampagneTypeValg] & "*") AND ((tblKampagneData.Målgruppe) Like "*" & [Formularer]![frmAnalyseRapporter]![cboMålgruppeValg] & "*") AND ((tblKampagneData.Kunderelation) Like "*" & [Formularer]![frmAnalyseRapporter]![cboKunderelationValg] & "*")) GROUP BY tblKampagneFormål.[KampagneFormål tekst], tblKampagneData.KampagneFormål HAVING (((tblKampagneData.KampagneFormål) Like "*" & [Formularer]![frmAnalyseRapporter]![cboKampagneformålValg] & "*"));
Have you tried changing the SQLin the query? If so does it give you what you want to see?
If it gives you what you want to see then in the combos AFTER UPDATE event you need to change the SQL in the query using the example I gave. Then you need to requery the form where you use the query!
no matter what method you choose you will STILL need to requery the form when you choose another entry from the combo!
Kan du ikke opbygge en string: strSQL="SELECT tblData.KampagneStørrelse" & _ " FROM tblData" & _ " WHERE tblData.KampagneStørrelse " & [Formularer]![Formular]![cboIntervalValg] & ";" Værdierne i comboboxen kan så f.eks. være =1 Between 5 And 8 >100
The solution is ok, if you only use one criterie, but I need to have a solution that works with all the other criteria, som I ended up with a solution where the cbo.. returns a from value and a to value. This works with til Between syntax.
The only problem now is, that I need to have a default value in the cbo.. when opening the form/query
Thanks for your effort and time ... the same to you > fdata
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.