473,497 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Understanding Dlookup function ...

Hello all,
When I use the Dlookup function I get the errormsg "Runtime error 2001 - You
canceled the previous operation" ... Can anybody tell me what I do wrong
here ?
Here is the snippet ... :

DoCmd.GoToRecord , , acNewRec
[Docnummer] = nBriefnum
[Docnummerstr] = sBriefstr
[Datumgemaakt] = Date
Me!txtOreflettersA.Value = DLookup("[Initialen]", "tblMwerkers",
"[Volledigenaam] = sNaamschrijver")

Any help very much appreciated ...
Ronny Sigo
Nov 12 '05 #1
2 3302
"Ronny Sigo" <ro********@skynet.be> wrote in message
news:3f*********************@reader2.news.skynet.b e...
Hello all,
When I use the Dlookup function I get the errormsg "Runtime error 2001 - You
canceled the previous operation" ... Can anybody tell me what I do wrong
here ?
Here is the snippet ... :

DoCmd.GoToRecord , , acNewRec
[Docnummer] = nBriefnum
[Docnummerstr] = sBriefstr
[Datumgemaakt] = Date
Me!txtOreflettersA.Value = DLookup("[Initialen]", "tblMwerkers",
"[Volledigenaam] = sNaamschrijver")


If sNaamschrijver is a text variable it needs to be delimited so that the
expression gets the value of the variable passed to it instead of the name of
the variable.

Me!txtOreflettersA.Value = DLookup("[Initialen]", "tblMwerkers",
"[Volledigenaam] = '" & sNaamschrijver & "'")
Nov 12 '05 #2
Thanks Rick ... works perfectly ....

"Rick Brandt" <rv********@sbcglobal.net> wrote in message
news:bl************@ID-98015.news.uni-berlin.de...
"Ronny Sigo" <ro********@skynet.be> wrote in message
news:3f*********************@reader2.news.skynet.b e...
Hello all,
When I use the Dlookup function I get the errormsg "Runtime error 2001 - You canceled the previous operation" ... Can anybody tell me what I do wrong
here ?
Here is the snippet ... :

DoCmd.GoToRecord , , acNewRec
[Docnummer] = nBriefnum
[Docnummerstr] = sBriefstr
[Datumgemaakt] = Date
Me!txtOreflettersA.Value = DLookup("[Initialen]", "tblMwerkers",
"[Volledigenaam] = sNaamschrijver")
If sNaamschrijver is a text variable it needs to be delimited so that the
expression gets the value of the variable passed to it instead of the name

of the variable.

Me!txtOreflettersA.Value = DLookup("[Initialen]", "tblMwerkers",
"[Volledigenaam] = '" & sNaamschrijver & "'")

Nov 12 '05 #3

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

Similar topics

1
20736
by: KLAU | last post by:
I have a field that retrieves information from an expression in a query. I have used a DLookup function to get the calculated field from the query. However, the relationship is 1-to-many so one...
4
440
by: David B | last post by:
I have a Public function which creates a back up copy of a back end. It works fine with the source path and source file as C:\folder\etc. I thought I would try to store the paths in a table so...
2
14922
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...
1
2354
by: Thelma Lubkin | last post by:
I am still struggling with trying to match a user supplied string with strings in a field of a table, where spaces are to be ignored. Arno suggested that I use the Dlookup function, but I...
6
508
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...
13
2928
by: nzyui | last post by:
Trying to lookup a field from a table called condition this is a separate table not linked to anything: setup as shown Code S M L DG 1 2 3 RI 2 4 5 need...
2
2259
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
3626
by: Denise | last post by:
Front end is Access 2002, back end is linked Oracle tables. My users need to describe things in feet and inches and want to use the standard ' and " abbrevations. On a testing form I go to a...
7
1747
Breezwell
by: Breezwell | last post by:
This is probably a simple question for someone out there. I understand that the DLookup function takes has the following syntax: DLookup(expression,domain,) From what I have read, domain can...
0
6993
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
7162
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
7197
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...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4584
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.