Filter by first two numbers

G

Gator

I have a Table with ID's like....010101, 010102, 020101, 020102,....
First, I want to make list0 show distinct first two numbers, like....
01
02
03
then I want list2, which will contain the full numbers to be filtered by
those first two numbers from list0's selection.
Something like,

list0_click
list2.RowSource="Select ID FROM Table1 WHERE ***FIRST TWO LETTERS IN
LIST2(TABLE1) ARE LIKE LIST0

many thanks
 
S

Scott Lichtenberg

Use the LEFT function. WHERE LEFT(MyField, 2) = "00"

Please keep in mind that the LEFT (as well as the similar RIGHT and MID)
function is a string function. It will return a string. You will have to
compare the result to another string. "20" does not equal 20.
 
G

Gator

how do I get list0 to only list the first two numbers, of the same number,
only once in the list, and not all the records?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

coding for criteria 6
List Boxes 1
Set Focus & 2108 error 5
can't get query to group 3
List Boxes -Help 5
criteria expression for list box 3
Don't want to return blank records 3
Sync Scrolling of Two Listboxes 1

Top