By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,505 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,505 IT Pros & Developers. It's quick & easy.

Can This Dlookup Work?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.