Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot find column C1 error

Status
Not open for further replies.

slames

Technical User
Nov 5, 2002
211
GB
Hi - not sure if anyone can help me with this, I am building a module to obtain information from a query and using it to calcualte a cost. I am receiving a strange error:

Runtime error 30020:
Cannot find column: 'Cannot find column 'C1''

I do not have any columns called C1 or any references to one. the query I am getting information from does have row numbers added to it but otherwise just a normal query.

I am working with an access front end on a sql server 2000 back end.

This is one of the lines of code that throws the error:

pagecount = DLookup("bkPagecount", "[" & selectQuery & "]")

where selectQuery is the name of the stored procedure.

Any help on this appreciated

Thanks

Steph
 
Steph

Wll, "C1" has to come from soemwhere.

pagecount = DLookup("bkPagecount", "[" & selectQuery & "]")

I am sure you know, but the syntax for DLookup is...
DLookup("[FieldName]", "tableName", "[SearchField] = " & SearchCriteria)


Does you selectQuery provide the name of the table to use?

Have you used the immediate window to see what selectQuery contains.

When you get the error, CTRL-G
Then in the blank window enter
? selectQuery


A common typo is to put a space somewhere, or forget a "," comman in select statement.

Still can't see it?

Copy the printed output from the immediate window.
Open Query Builder, don't add any tables.
Switch to SQL view, and paste the code.
Add the ";" semicolon at the end of the sentence and then run the SQL.
Query Builder will stop at the point it can't understand the syntax.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top