Dlookup for a number field (1 Viewer)

cocowomble

Registered User.
Local time
Today, 06:30
Joined
May 25, 2014
Messages
25
hi all.

I have a code that works fine if the field in the table is a short txt field, however I need the field to be a number field, and therefore the code doesn't work.

the code I'm using is

If Not IsNull(DLookup("[SquadNumber]", "tblPlayers", "[Squadnumber] = '" & Me!SquadNumber & "'")) Then........

guess i'm missing something really basic, but don't know what????



thanks for your help
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:30
Joined
Feb 19, 2013
Messages
16,708
yes really basic - when looking for text, you use the single quotes, when looking for a number, you don't

If Not IsNull(DLookup("[SquadNumber]", "tblPlayers", "[Squadnumber] = " & Me!SquadNumber)) Then........
 

sneuberg

AWF VIP
Local time
Today, 06:30
Joined
Oct 17, 2014
Messages
3,506
For numbers you don't want the single quotes try:


If Not IsNull(DLookup("[SquadNumber]", "tblPlayers", "[Squadnumber] = " & Me!SquadNumber )) Then........
 

Users who are viewing this thread

Top Bottom