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!

Run Time 3070 error

Status
Not open for further replies.

maxxev

Technical User
Jul 17, 2008
139
NL
Hi, I have investigated this error on google and I believe I know WHY the error is occuring (lack of single quotes) however I don't have the knowledge to work out where to put them.... :(

I'm really not great at programming here is my code:

Code:
ProductDec: Concatenate("SELECT Ing_Dec_Fin FROM QProductIngredientLine WHERE [Full_Product_Code] = " & [Full_Product_Code] & "  ORDER BY [QUID%] DESC")

[Full_Product_Code] is a string value which I think is the issue. Besides anything else this exact code with a numeric Primary key on another query works perfectly (though extrememly slow).

Cheers
 
Put in the single quotes
Code:
ProductDec: Concatenate("SELECT Ing_Dec_Fin FROM QProductIngredientLine " & _
"WHERE [Full_Product_Code] = [b][red]'[/red][/b]" & [Full_Product_Code] & "[b][red]'[/red][/b]  ORDER BY [QUID%] DESC")
 

How about this?
Code:
ProductDec: Concatenate("SELECT Ing_Dec_Fin FROM QProductIngredientLine WHERE [Full_Product_Code] = [b][COLOR=red]'[/color][/b]" & [Full_Product_Code] & "[b][COLOR=red]'[/color][/b]  ORDER BY [QUID%] DESC")


Randy
 
Hi thank you, Randy your codes seems to work... I say seems to work as the query now runs, however nothing seems to be happening and Access freezes up... :(

I guess that means something is wrong further down.

However as i've said before I have a similar series of queries ending in identicle codes which does work, even if it takes 10 mins to run.

I need to find a way to speed this all up. :(

Cheers for the help.
 

Try putting in break points and stepping through the code to find out when/where it's encountering a problem.


Randy
 
How many records are in your tables/queries?

Are [Full_Product_Code] and [QUID%] indexed in all tables?

I assume QProductIngredientLine is a query. What is its SQL?

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top