F
Faberman
In my app., the user can use a form to insert a record into a table.
The table holds line data for quotations.
i.e.
QuoteNo, SubQuoteNo, LineNo, etc., etc., etc.
When the new line is added, all the line records whose LineNo is >= to the
new LineNo are re-assigned LineNo's. e.g. LineNo = LineNo + 1.
When the record is added, I would like to order the records by QuoteNo,
SubQuoteNo and LineNo so that when all the line data records are viewed (in a
different form), they essentially appear in LineNo order (first line1, next
line down line2, and so on).
Access adds the new line at the end of the relevant line data records.
I have been trying something on the lines of :
DoCmd.RunSQL ("SELECT * From QLine WHERE (((QLine.QuoteNo) =
[Forms]![frmqlineaddition]![QNo]) And ((QLine.SubQuoteNo) =
[Forms]![frmqlineaddition]![SQNo]))ORDER BY QLine.QuoteNo DESC,
QLine.SubQuoteNo DESC, QLine.LineNo DESC;")
At the moment, I get -
Run-time error 2342
A RunSQL action requires an argument consisting of an SQL statement.
For starters, I was under the impression that I was using an SQL statement
as an argument.
And, secondly, is there a better way to do this?
Thanks.
The table holds line data for quotations.
i.e.
QuoteNo, SubQuoteNo, LineNo, etc., etc., etc.
When the new line is added, all the line records whose LineNo is >= to the
new LineNo are re-assigned LineNo's. e.g. LineNo = LineNo + 1.
When the record is added, I would like to order the records by QuoteNo,
SubQuoteNo and LineNo so that when all the line data records are viewed (in a
different form), they essentially appear in LineNo order (first line1, next
line down line2, and so on).
Access adds the new line at the end of the relevant line data records.
I have been trying something on the lines of :
DoCmd.RunSQL ("SELECT * From QLine WHERE (((QLine.QuoteNo) =
[Forms]![frmqlineaddition]![QNo]) And ((QLine.SubQuoteNo) =
[Forms]![frmqlineaddition]![SQNo]))ORDER BY QLine.QuoteNo DESC,
QLine.SubQuoteNo DESC, QLine.LineNo DESC;")
At the moment, I get -
Run-time error 2342
A RunSQL action requires an argument consisting of an SQL statement.
For starters, I was under the impression that I was using an SQL statement
as an argument.
And, secondly, is there a better way to do this?
Thanks.