Connecting Tech Pros Worldwide Help | Site Map

Proper "LIKE" Syntax

  #1  
Old November 12th, 2005, 04:43 PM
Rick Brown
Guest
 
Posts: n/a
I'm trying to scan a barcode that contains the text string
"BPWOT08762" into a textbox for use in a DLookup or query grid.

I want to look thru a table's field that contains the last 6
characters of the barcode plus a 1 character prefix.


Test Data in table:

SerialNumber
MP40789
MP39718
S583424
MT08762 <<<<<<<<<<<<<<
S581724
MP39048
MP37338
S583199
MP37584


I want to return the seven character serial number(MT08762) from the
table.

The return will be used in a Labels textbox.

I've tried to do this in a query grid but can't get the syntax right.

Failed attempt follows: Like '*" &
right([Forms]![Form1]![SerialNumber],6) & "'

I can code if required.(sort of)<g>

TIA, Rick
  #2  
Old November 12th, 2005, 04:43 PM
Jim Allensworth
Guest
 
Posts: n/a

re: Proper "LIKE" Syntax


On 20 Nov 2003 14:42:27 -0800, rbrowniii@compuserve.com (Rick Brown)
wrote:
[color=blue]
>I'm trying to scan a barcode that contains the text string
>"BPWOT08762" into a textbox for use in a DLookup or query grid.
>
>I want to look thru a table's field that contains the last 6
>characters of the barcode plus a 1 character prefix.
>
>
>Test Data in table:
>
>SerialNumber
>MP40789
>MP39718
>S583424
>MT08762 <<<<<<<<<<<<<<
>S581724
>MP39048
>MP37338
>S583199
>MP37584
>
>
>I want to return the seven character serial number(MT08762) from the
>table.
>
>The return will be used in a Labels textbox.
>
>I've tried to do this in a query grid but can't get the syntax right.
>
>Failed attempt follows: Like '*" &
>right([Forms]![Form1]![SerialNumber],6) & "'
>
>I can code if required.(sort of)<g>
>[/color]

It looks like you have a mix of single and double quotes: Try...
Like "*" & right([Forms]![Form1]![SerialNumber],6)


- Jim

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python's "only one way to do it" philosophy isn't good? WaterWalk answers 206 July 9th, 2007 02:25 PM
Opera guesses encoding for "application/xml" Christoph Schneegans answers 43 June 11th, 2006 02:05 PM
Microsoft not content with "dissing" just the Classic VB Developer Army.... Jim Hubbard answers 96 November 21st, 2005 05:34 PM
Microsoft not content with "dissing" just the Classic VB Developer Army.... Jim Hubbard answers 99 July 22nd, 2005 12:32 AM