G
Guest
I have a User requriement to dynamically enter a line number in report
definitions and existing line numbers > new line number get incremented so
that all sections order correctly. (Cobol bleah!)
I am using a continuous subform to show report sections.
tblReportSections
RptSecID PK
RptID
SectionID long
SectionDescript
"TEST",0,"00Section"
"TEST",1,"01Section"
"TEST",2,"02Section"
"TEST",3,"03Section"
"TEST",4,"04Section"
Insert new section (1) and renumber existing greater than new
"TEST",0,"00Section"
"Test",1,"New 01Section" (New Entry)
"TEST",2,"01Section"
"TEST",3,"02Section"
"TEST",4,"03Section"
"TEST",5,"04Section"
I created a unique index on RptID and SectionID. Throws correct error 3022
from continuous form in form_error. Query below will work to update except
that the rows to be updated must be ordered Descending to not throw another
3022 error.
Is there a way to order the records to be updated in descending order so
that this will work?
UPDATE tblReportSection SET tblReportSection.SectionID = [SectionID]+1
WHERE (((tblReportSection.SectionID)>=[iRptSec]) AND
((tblReportSection.RptID)=[iRptID]));
Thanks in advance
definitions and existing line numbers > new line number get incremented so
that all sections order correctly. (Cobol bleah!)
I am using a continuous subform to show report sections.
tblReportSections
RptSecID PK
RptID
SectionID long
SectionDescript
"TEST",0,"00Section"
"TEST",1,"01Section"
"TEST",2,"02Section"
"TEST",3,"03Section"
"TEST",4,"04Section"
Insert new section (1) and renumber existing greater than new
"TEST",0,"00Section"
"Test",1,"New 01Section" (New Entry)
"TEST",2,"01Section"
"TEST",3,"02Section"
"TEST",4,"03Section"
"TEST",5,"04Section"
I created a unique index on RptID and SectionID. Throws correct error 3022
from continuous form in form_error. Query below will work to update except
that the rows to be updated must be ordered Descending to not throw another
3022 error.
Is there a way to order the records to be updated in descending order so
that this will work?
UPDATE tblReportSection SET tblReportSection.SectionID = [SectionID]+1
WHERE (((tblReportSection.SectionID)>=[iRptSec]) AND
((tblReportSection.RptID)=[iRptID]));
Thanks in advance