473,395 Members | 1,679 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,395 software developers and data experts.

variable (long) as criteria for Dlookup

Hello all,
I want to perform a DLookup function with a variable (long) as critera.
I know if it was a string this would be the correct syntax :
Me!txtStad.Value = DLookup("[Name]", "tblPostnummers", "[Id] = '" &
sBoxvalue & "'")
Can anybody give me the correct syntax when boxvalue is a number (long) (In
that case it would be called nBoxvalue.
I don't seem to understand the delimiting :(:(:(
Any help appreciated ....
Thanks
Ronny Sigo
Nov 12 '05 #1
2 6090
Me!txtStad = DLookup("[Fieldname]". "tblPostnummers","[Id] = " & nBoxValue)

Note that when using a number for the criteria that there is no need for the
apostrophe before and after the variable. I've removed the .Value from your
syntax because .Text is the default property.
Warning! Don't use the word "Name" as a field name because it is a reserved
word in Access and it may cause problems down the track.

Stewart
"Ronny Sigo" <ro*********@erfgoednet.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I want to perform a DLookup function with a variable (long) as critera.
I know if it was a string this would be the correct syntax :
Me!txtStad.Value = DLookup("[Name]", "tblPostnummers", "[Id] = '" &
sBoxvalue & "'")
Can anybody give me the correct syntax when boxvalue is a number (long) (In that case it would be called nBoxvalue.
I don't seem to understand the delimiting :(:(:(
Any help appreciated ....
Thanks
Ronny Sigo

Nov 12 '05 #2
Thanks Stewart :)
"Stewart Allen" <sa****@REMOVETHISwave.co.nz> schreef in bericht
news:bl**********@news.wave.co.nz...
Me!txtStad = DLookup("[Fieldname]". "tblPostnummers","[Id] = " & nBoxValue)
Note that when using a number for the criteria that there is no need for the apostrophe before and after the variable. I've removed the .Value from your syntax because .Text is the default property.
Warning! Don't use the word "Name" as a field name because it is a reserved word in Access and it may cause problems down the track.

Stewart
"Ronny Sigo" <ro*********@erfgoednet.be> wrote in message
news:3f**********************@feed0.news.be.easyne t.net...
Hello all,
I want to perform a DLookup function with a variable (long) as critera.
I know if it was a string this would be the correct syntax :
Me!txtStad.Value = DLookup("[Name]", "tblPostnummers", "[Id] = '" &
sBoxvalue & "'")
Can anybody give me the correct syntax when boxvalue is a number (long)

(In
that case it would be called nBoxvalue.
I don't seem to understand the delimiting :(:(:(
Any help appreciated ....
Thanks
Ronny Sigo


Nov 12 '05 #3

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

Similar topics

6
by: deko | last post by:
Set strFoundCt = ("SELECT COUNT(*) FROM (SELECT DISTINCT Entity_ID FROM qrySearch" & strPxSx) This doesn't work, but hopefully describes what I'm trying to do. I have several different queries...
4
by: ShyGuy | last post by:
I have a table with 4 fields. Three are used for criteria. I can get the DLookup to work with 1 criteria with the following but can't get it to work with 2 or three. NumofAppts = DLookup("",...
1
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items...
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)...
6
by: bjaj | last post by:
Hi How do I use a boolean criterian with the funktion DLookup ? I know the syntax for strings, numeric and date as follows For numerical values: DLookup("FieldName" , "TableName" ,...
21
by: Thelma Lubkin | last post by:
I would like my DLookup criteria to say this: Trim(fieldX) = strVar: myVar = _ DLookup("someField", "someTable", "Trim(fieldX) = '" & strVar & '") I don't believe that this will work, and I...
3
MSeda
by: MSeda | last post by:
I have a loop that is controlled by a Dlookup statement with two criteria. Both criteria fields are checkboxes. I have tried an assortment of quotation marks in the criteria section and cannot get...
2
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...
30
by: DH22 | last post by:
Access 03 I'm currently having an issue using Dlookup when trying to reference a query (criteria syntax) Currently I have 1 table, which is L_Emps (which contains Employee_ID as my key...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
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...

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.