473,785 Members | 2,165 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.GoToRecor d , , acNewRec
[Docnummer] = nBriefnum
[Docnummerstr] = sBriefstr
[Datumgemaakt] = Date
Me!txtOreflette rsA.Value = DLookup("[Initialen]", "tblMwerker s",
"[Volledigenaam] = sNaamschrijver" )

Any help very much appreciated ...
Ronny Sigo
Nov 12 '05 #1
2 3323
"Ronny Sigo" <ro********@sky net.be> wrote in message
news:3f******** *************@r eader2.news.sky net.be...
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.GoToRecor d , , acNewRec
[Docnummer] = nBriefnum
[Docnummerstr] = sBriefstr
[Datumgemaakt] = Date
Me!txtOreflette rsA.Value = DLookup("[Initialen]", "tblMwerker s",
"[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!txtOreflette rsA.Value = DLookup("[Initialen]", "tblMwerker s",
"[Volledigenaam] = '" & sNaamschrijver & "'")
Nov 12 '05 #2
Thanks Rick ... works perfectly ....

"Rick Brandt" <rv********@sbc global.net> wrote in message
news:bl******** ****@ID-98015.news.uni-berlin.de...
"Ronny Sigo" <ro********@sky net.be> wrote in message
news:3f******** *************@r eader2.news.sky net.be...
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.GoToRecor d , , acNewRec
[Docnummer] = nBriefnum
[Docnummerstr] = sBriefstr
[Datumgemaakt] = Date
Me!txtOreflette rsA.Value = DLookup("[Initialen]", "tblMwerker s",
"[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!txtOreflette rsA.Value = DLookup("[Initialen]", "tblMwerker s",
"[Volledigenaam] = '" & sNaamschrijver & "'")

Nov 12 '05 #3

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

Similar topics

1
20805
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 site could have many units. How do I have the DLookUp field value change to a newly calcuated field when I navigate through the units? please see example below: On the Form: A site can have many units.
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 that any future changes could be made in the table rather than going into the code. I have been trying to get DLookup to work as below. Any reason why I should be getting probs ? I have tested these in a text box and they return as expected.
2
14941
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 code I get the error "You canceled the previous operation" err msg. When clicking on Help I get a white screen. I haven't got the slightest idea what it means .... I pinned down that this error comes from the Dlookup function, because if I put...
1
2386
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 apparently can't get its syntax right. Access gives me "Run-time error '2001' You canceled the previous operation" url: http://www.fontstuff.com/access/acctut15.htm, a set of 'Access Tips' has this to say about this error:
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 I've said. It doesn't populate until I go to a new record. Then if I go back to the record the number is in the field. Instead of populating immediately it waits until I've created a new record. Am I making sense with this description. Here's...
13
2969
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 a dlookup to give me a single code as in number 1 2 3 all from a form thats entered by user ie: condition code DG severity L nedd to return 5 cheers
2
2277
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 used DLookup several times and I've actually re-created the same lookup just in different forms. Here's my problem. I'm using dlookup when I enter a part description it adds the part number for me. I choose the part description from a combo...
2
3662
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 record with double or single quotes in the location description and click a button to see if Access can tell me the ID number and find its way back to the original record. When the text contains double quotes the FindFirst works but the Dloookup...
7
1767
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 be a table or query. I have no problem getting the function to work when I use the actual name of a table for the domain. My question is, can I utilize a combobox that lists the names of my tables and pass the value of the selected table from...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5396
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
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 we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.