Problem with a qry

  • Thread starter Dimitris Nikolakakis
  • Start date
D

Dimitris Nikolakakis

I have the following qry:

SELECT [OrdersTx].[OrderNo],
LTRIM(Format([OrdersTx.StorageItem],"@@@@@@@@@@@@@@@@@@@@")) AS StorageItem,
[OrdersTx].[Quantity]
FROM OrdersTx
WHERE [Forms]![FOrders]!OrderID=[OrdersTx].[OrderNo] And
[OrdersTx].[typeID]="ORD";

and I have a button on the form FOrders that:

DoCmd.OutputTo acOutputQuery, "qOrder_XLS(IRWIN)", acFormatXLS,
"c:\order.xls", 0

For at least one time it works, but in a very strange way after some times I
get error after I press the button that there is
no field in the qry. I open the qry in design and I see no field. I have to
rewrite it and save it.

What can I do?


thanks
 
M

[MVP] S. Clark

Assume for a minute that the Ltrim(format()) combo is causing the problem,
thus want to explore other ways to accomplish the same task.

Why do you need to force the StorageItem field to use 20 characters? Why do
you then need to Trim any blanks? What are some example value for this data?


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 

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


Top