473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

dlookup problem

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
4 1779
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
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
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
ug********@hotmail.com wrote:
i learned more on newsgroup than in my VBA classes.


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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ronny Sigo | last post by:
Hello all, I already put the same question, only now I have more to tell ... Although I used this code before in the same routine (only the fieldname of the table differs) ___ at this point in the...
0
by: Tony Williams | last post by:
I have posted a number of posts in the Access newsgroups concerning my problem with DLookup. I have had a number of the experts with helpful suggestions but I still can't get it to work! This is...
2
by: ctyrrell | last post by:
I have read with interest the many discussions of the 3048 Error: Cannot open any more databases. I understand how the number of open Table ID's causes the problem. My question has to do with the...
8
by: Christine Henderson | last post by:
I have a problem using the above function in the following simplified circumstance: In the lookup table called "Klms Travelled" I have 3 fields, eg: Receiver Name Receiver Suburb ...
6
by: Don Sealer | last post by:
I've written this expression for a DLookup function. It works almost alright. What I'm trying to do is type in a description and the ID field (number) populates automatically. It works almost as...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
2
by: chris.thompson13 | last post by:
I am having a problem setting the criteria part of the DLookup method correctly and am consequently getting an error message. I have a database of staff duties, part of which is a query (qryDaily)...
2
by: Don | last post by:
Can someone help me fix my DLookup problem. I'm far from proficiency with Access. I've been creating databases for several years for work with the help of many of you and trial and error. I have...
2
by: boyleyc | last post by:
Hi all the following code works perfectly well. Basically it populates a series of check boxes on my form, depending on whether dlookup finds an associated record. The problem i have is that...
15
by: rleepac | last post by:
This is a little complicated but I'll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue This is a table used to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.