By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,639 Members | 2,000 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,639 IT Pros & Developers. It's quick & easy.

dlookup problem

P: n/a
hi this is my code (sorry most of it is in french)
Dim strFiltre As String, strCherché As String, Résultat As Variant
Dim strnumerovendeur As String

'Obtenir le nom d'un client
strnumerovendeur = Me.Numero_Vendeur.Value

strCherché = strnumerovendeur
strFiltre = "Numero Vendeur='" & strCherché & "'"
Résultat = DLookup("Nom_Vendeur", "tbl Livreurs-Vendeurs",
strFiltre)
Me.Nom_vendeur = Résultat

looks like a i have error 3075 : missing operator in the dlookup
how can i correct it????

thx a lot...

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ug********@hotmail.com wrote:
Dim strFiltre As String, strCherché As String, Résultat As Variant
Dim strnumerovendeur As String

'Obtenir le nom d'un client
strnumerovendeur = Me.Numero_Vendeur.Value

strCherché = strnumerovendeur
strFiltre = "Numero Vendeur='" & strCherché & "'"
Résultat = DLookup("Nom_Vendeur", "tbl Livreurs-Vendeurs",
strFiltre)
Me.Nom_vendeur = Résultat

looks like a i have error 3075 : missing operator in the dlookup
how can i correct it?


Is 'Numero Vendeur' a number field type? If so then you do not need the
single-quotes around strCherché.

Also enclose the name in square brackets [] as it contains a space.

strFiltre = "[Numero Vendeur]=" & strCherché
or
strFiltre = "[Numero Vendeur]='" & strCherché & "'"

HTH - Keith.
www.keithwilby.com
Nov 13 '05 #2

P: n/a
You must use square brackets around names that contain a space, e.g.:
strFiltre = "[Numero Vendeur] ='" & strCherché & "'"
Résultat = DLookup("Nom_Vendeur", "[tbl Livreurs-Vendeurs]", strFiltre)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<ug********@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
hi this is my code (sorry most of it is in french)
Dim strFiltre As String, strCherché As String, Résultat As Variant
Dim strnumerovendeur As String

'Obtenir le nom d'un client
strnumerovendeur = Me.Numero_Vendeur.Value

strCherché = strnumerovendeur
strFiltre = "Numero Vendeur='" & strCherché & "'"
Résultat = DLookup("Nom_Vendeur", "tbl Livreurs-Vendeurs",
strFiltre)
Me.Nom_vendeur = Résultat

looks like a i have error 3075 : missing operator in the dlookup
how can i correct it????

thx a lot...
Nov 13 '05 #3

P: n/a
thank u so much its working like a charm,
i learned more on newsgroup than in my VBA classes.

thx again.

Nov 13 '05 #4

P: n/a
ug********@hotmail.com wrote:
i learned more on newsgroup than in my VBA classes.


You and me both :o)
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.