List Box Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that contains a list box with the following properties

Name:

lstJOBREF

Row Source Type:

Table/Query
Row Source:

SELECT [Job Master File].[JOB REF]
FROM [Job Master File]
WHERE ((([Job Master File].[JOB REF]) Not In
("P1","P2","P3","P4","P5","PM1")) AND (([Job Master File].[JOB COMPLETE])
Between [START] And [END]) AND (([Job Master File].CO)=2))

Column Count:1
Bound Column:1

When the form is opened, I get the following error message:

"Characters found after end of SQL statement"

Can anyone help?
 
I made a table, form and listbox. I pasted the SQL in the list box row
source; works perfectly....no errors.

Things to check/try:

Do you have "Track Name Autocorrect" turned off? (Tools/Options - General
tab - uncheck it)

Try doing a Compile and Repair.


Create a query and set the recordsource to:

SELECT [Job Master File].[JOB REF]
FROM [Job Master File]


If that works with no errors add a condition:

SELECT [Job Master File].[JOB REF]
FROM [Job Master File]
WHERE [Job Master File].[JOB REF] Not In
("P1","P2","P3","P4","P5","PM1")


If that works add another condition. Keep adding conditions until you get
the results you want with no errors. Copy the SQL of the query and paste it
into the list box.


HTH
 
Thanks Steve, works perfectly now
--
K Hogwood-Thompson


SteveS said:
I made a table, form and listbox. I pasted the SQL in the list box row
source; works perfectly....no errors.

Things to check/try:

Do you have "Track Name Autocorrect" turned off? (Tools/Options - General
tab - uncheck it)

Try doing a Compile and Repair.


Create a query and set the recordsource to:

SELECT [Job Master File].[JOB REF]
FROM [Job Master File]


If that works with no errors add a condition:

SELECT [Job Master File].[JOB REF]
FROM [Job Master File]
WHERE [Job Master File].[JOB REF] Not In
("P1","P2","P3","P4","P5","PM1")


If that works add another condition. Keep adding conditions until you get
the results you want with no errors. Copy the SQL of the query and paste it
into the list box.


HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


KHogwood-Thompson said:
I have a form that contains a list box with the following properties

Name:

lstJOBREF

Row Source Type:

Table/Query
Row Source:

SELECT [Job Master File].[JOB REF]
FROM [Job Master File]
WHERE ((([Job Master File].[JOB REF]) Not In
("P1","P2","P3","P4","P5","PM1")) AND (([Job Master File].[JOB COMPLETE])
Between [START] And [END]) AND (([Job Master File].CO)=2))

Column Count:1
Bound Column:1

When the form is opened, I get the following error message:

"Characters found after end of SQL statement"

Can anyone help?
 
Back
Top