Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Errore di sintassi (operatore mancante)

102 views
Skip to first unread message

Massimo

unread,
May 21, 2009, 7:53:55 AM5/21/09
to
Ciao a tutti, sto cercando di veneire a capo del problema che ho
postato ieri.
In una combo box sull'evento "modifica" ho scritto questo codice:

Dim CaratteriDigitati As String
Dim strsql As String
CaratteriDigitati = Nz(Me!Test.Text, "")
strsql = "SELECT DISTANZE.DISTANZE_TAPPA2, DISTANZE.DISTANZE_TAPPA1,
DISTANZE.DISTANZE_KM, DESTINAZIONE.DESTINAZIONE_NOME,
DESTINAZIONE.DESTINAZIONE_INDIRIZZO, DISTANZE.IDDISTANZE" _
& " FROM DISTANZE INNER JOIN DESTINAZIONE ON
DISTANZE.DISTANZE_TAPPA2 = DESTINAZIONE.DESTINAZIONE_ID" _
& " WHERE destinazione_nome LIKE '*" & CaratteriDigitati & "*'"
Debug.Print strsql
Me!Test.RowSource = strsql

Tutto ok tranne che mi popola la combo con i valori duplicati e così
via, cosi decido di usare GROUP BY in questo modo


Dim CaratteriDigitati As String
Dim strsql As String
CaratteriDigitati = Nz(Me!Test.Text, "")
strsql = "SELECT DISTANZE.DISTANZE_TAPPA2, DISTANZE.DISTANZE_TAPPA1,
DISTANZE.DISTANZE_KM, DESTINAZIONE.DESTINAZIONE_NOME,
DESTINAZIONE.DESTINAZIONE_INDIRIZZO, DISTANZE.IDDISTANZE" _
& " FROM DISTANZE INNER JOIN DESTINAZIONE ON
DISTANZE.DISTANZE_TAPPA2 = DESTINAZIONE.DESTINAZIONE_ID" _
& " GROUP BY DESTINAZIONE.DESTINAZIONE_NOME" _
& " WHERE destinazione_nome LIKE '*" & CaratteriDigitati & "*'"
Debug.Print strsql
Me!Test.RowSource = strsql

Risultato: mi va in errore dicendomi "errore di sintassi (operatore
mancante) nell'espressione della query DESTINAZIONE.DESTINAZIONE_NOME
WHERE destinazione_nome LIKE '*9*"
Stesso discorso se provo ad ordinare i dati usando ORDER BY

Non riesco a capire il problema....

Grazie per l'aiuto

Massimo

Bruno Campanini

unread,
May 21, 2009, 10:34:25 AM5/21/09
to
"Massimo" <maxpall...@libero.it> wrote in message
news:cacf82ac-dcd7-47a8...@r34g2000vba.googlegroups.com...

Ciao a tutti, sto cercando di veneire a capo del problema che ho
postato ieri.
In una combo box sull'evento "modifica" ho scritto questo codice:

Dim CaratteriDigitati As String
Dim strsql As String
CaratteriDigitati = Nz(Me!Test.Text, "")
strsql = "SELECT DISTANZE.DISTANZE_TAPPA2, DISTANZE.DISTANZE_TAPPA1,
DISTANZE.DISTANZE_KM, DESTINAZIONE.DESTINAZIONE_NOME,
DESTINAZIONE.DESTINAZIONE_INDIRIZZO, DISTANZE.IDDISTANZE" _
& " FROM DISTANZE INNER JOIN DESTINAZIONE ON
DISTANZE.DISTANZE_TAPPA2 = DESTINAZIONE.DESTINAZIONE_ID" _
& " WHERE destinazione_nome LIKE '*" & CaratteriDigitati & "*'"
Debug.Print strsql
Me!Test.RowSource = strsql

Tutto ok tranne che mi popola la combo con i valori duplicati e cos�


via, cosi decido di usare GROUP BY in questo modo

[...]

Tu le query le scrivi a mano? non usi la griglia QBE?

Bruno

0 new messages