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

Can This Dlookup Work?

a2k (9.0.6926) SP-3 Jet 4.0 SP-7

strDogTagID in table containes 1234567-A, the first 7 characters in
each record are unique

strDogTagID in the form containes 1234567

In After Update Event in form, how can I lookup information in the dog
record using the first 7 characters of strDogTagID?

The following dosen't work

dtmRTDate = Nz(DLookup("[dtmRTDate]", "[tbl_DLicense]", _
"[Left(strDogTagID, 7)] = """ &
[strDogTagID] & """"), Null)

How about SQL replacement syntax?

Thanks, John
Nov 12 '05 #1
2 1556
On 29 Dec 2003 14:12:00 -0800, Su**********@aol.com (Support4John)
wrote:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

strDogTagID in table containes 1234567-A, the first 7 characters in
each record are unique

strDogTagID in the form containes 1234567

In After Update Event in form, how can I lookup information in the dog
record using the first 7 characters of strDogTagID?

The following dosen't work

dtmRTDate = Nz(DLookup("[dtmRTDate]", "[tbl_DLicense]", _
"[Left(strDogTagID, 7)] = """ &
[strDogTagID] & """"), Null)

How about SQL replacement syntax?

Thanks, John

Try it like this (pun intended)...

dtmRTDate = DLookup("[dtmRTDate]", "[tbl_DLicense]", _
"strDogTagID Like '" & Me.strDogTagID & "*'")

This uses the Like operator. Putting a * on the end allows for
anything after the unique number. Also, you don't need the NZ function
because Dlookup will return a null if nothing is found.

- Jim
Nov 12 '05 #2
Thanks, it worked

"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote in message news:<3f****************@news.west.earthlink.net>. ..
On 29 Dec 2003 14:12:00 -0800, Su**********@aol.com (Support4John)
wrote:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7

strDogTagID in table containes 1234567-A, the first 7 characters in
each record are unique

strDogTagID in the form containes 1234567

In After Update Event in form, how can I lookup information in the dog
record using the first 7 characters of strDogTagID?

The following dosen't work

dtmRTDate = Nz(DLookup("[dtmRTDate]", "[tbl_DLicense]", _
"[Left(strDogTagID, 7)] = """ &
[strDogTagID] & """"), Null)

How about SQL replacement syntax?

Thanks, John

Try it like this (pun intended)...

dtmRTDate = DLookup("[dtmRTDate]", "[tbl_DLicense]", _
"strDogTagID Like '" & Me.strDogTagID & "*'")

This uses the Like operator. Putting a * on the end allows for
anything after the unique number. Also, you don't need the NZ function
because Dlookup will return a null if nothing is found.

- Jim

Nov 12 '05 #3

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

Similar topics

1
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
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...
6
by: JLM | last post by:
What am I missing here? I have a form where I enter a "Class Code". This value corresponds to what sits in table "class code descriptions" along with the "title" of each "class code." Key...
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: 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...
4
by: MLH | last post by:
I have tried using DLookUp in this manner... If DLookUp("","tblClients","='2021234567'") Then MsgBox "Found it!" End If I am wondering if that is a misuse of the DLookUp command? Type...
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...
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: 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
by: WannabePrgmr | last post by:
What I am trying to do is on the click event of "Command167", run a Dlookup on the number that was just typed into "cboMoveTo1" and find the value located in the table "tblName" in the "Open/Closed"...
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: 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:
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.