Limitation of Runsql, helpme please

N

Nova

I copy sql statement from query design and then paste it to Runsql in Macro
design, but it has more 255 Character. How can I do, This is my sql statement

INSERT INTO HistoryEQ ( ActDate, OrderNo, Code, Detail, Engineer1 )
SELECT MaintReport.StartDate AS ActDate, MaintReport.OrderNo, "PM" AS Code,
MaintReport.MaintID AS Detail, MaintReport.Engineer1
FROM MaintReport INNER JOIN RX ON MaintReport.MaintID=RX.MaintID
WHERE (((RX.AssetNo)=forms!Equipdetail.AssetNo));
 
O

Ofer

Try this

Docmd.RunSql "INSERT INTO HistoryEQ ( ActDate, OrderNo, Code, Detail,
Engineer1 )" & _
"SELECT MaintReport.StartDate AS ActDate, MaintReport.OrderNo, 'PM' AS Code,
" & _
" MaintReport.MaintID AS Detail, MaintReport.Engineer1 " & _
" FROM MaintReport INNER JOIN RX ON MaintReport.MaintID=RX.MaintID " & _
" WHERE (((RX.AssetNo)=forms!Equipdetail.AssetNo));"
 

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