Referencing list box column

  • Thread starter Thread starter jack
  • Start date Start date
J

jack

Hello,

I am having problems referencing a column in a list box

I have tried all manner of beast like the following but it
just doesn't want to play, could someone please tell me
where I'm going wrong - thanks

strClass = "SELECT classification FROM classifications
WHERE (((classifications.classification) not like 'forms!
[cor - edit]!list9.column(1)'))"
txtClass.RowSource = strClass


this loads the classifications but doesn't limit by the
column entries which are also classifications?
 
Try

strClass = "SELECT classification FROM classifications
WHERE (((classifications.classification) not like '" &
forms![cor - edit]!list9.column(1) & "'))"
txtClass.RowSource = strClass

One good tip when you have problems with SQL strings is to
place a bookmark on the line after you have formed the SQL
then open the Immediate window and enter
Debug.Print strClass

This will show you whether you have included the variable
as a literal or not.

Hope This Helps
Gerald Stanley MCSD
 
-----Original Message-----
Thanks for that Gerard, but it only works if i click onto
one line in the list and it only removes the highlighte
line, is there some way i can get it to look at the whole
column without having to click on the list ?
thanks

Try
strClass = "SELECT classification FROM classifications
WHERE (((classifications.classification) not like '" &
forms![cor - edit]!list9.column(1) & "'))"
txtClass.RowSource = strClass

One good tip when you have problems with SQL strings is to
place a bookmark on the line after you have formed the SQL
then open the Immediate window and enter
Debug.Print strClass

This will show you whether you have included the variable
as a literal or not.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hello,

I am having problems referencing a column in a list box

I have tried all manner of beast like the following but it
just doesn't want to play, could someone please tell me
where I'm going wrong - thanks

strClass = "SELECT classification FROM classifications
WHERE (((classifications.classification) not like 'forms!
[cor - edit]!list9.column(1)'))"
txtClass.RowSource = strClass


this loads the classifications but doesn't limit by the
column entries which are also classifications?


.
.
 
Do you mean that you wish to have an 'ALL' option in your
list? If so, can you post the RowSource SQL?

Gerald Stanley MCSD
-----Original Message-----
-----Original Message-----
Thanks for that Gerard, but it only works if i click onto
one line in the list and it only removes the highlighte
line, is there some way i can get it to look at the whole
column without having to click on the list ?
thanks

Try
strClass = "SELECT classification FROM classifications
WHERE (((classifications.classification) not like '" &
forms![cor - edit]!list9.column(1) & "'))"
txtClass.RowSource = strClass

One good tip when you have problems with SQL strings is to
place a bookmark on the line after you have formed the SQL
then open the Immediate window and enter
Debug.Print strClass

This will show you whether you have included the variable
as a literal or not.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hello,

I am having problems referencing a column in a list box

I have tried all manner of beast like the following but it
just doesn't want to play, could someone please tell me
where I'm going wrong - thanks

strClass = "SELECT classification FROM classifications
WHERE (((classifications.classification) not like 'forms!
[cor - edit]!list9.column(1)'))"
txtClass.RowSource = strClass


this loads the classifications but doesn't limit by the
column entries which are also classifications?


.
.
.
 
Back
Top