Hello:
I have a ADP project that I'm working on using SQL Server 2000. I have a form that needs to be available for both entering new records(updatable)and viewing.
Currently, the form is bound to a stored procedure called 'procqryAnnexSummation' as the Record Source. As a result of this type of binding, I can't designate a unique table in the in the UniqueTable property for the form's properties. So while I can view this form just fine,I'm unable to edit the form as it is set to a stored procedure.
The stored procedure called 'procqryAnnexSummation' looks like this:
CREATE Procedure dbo.procqryAnnexSummation
@ID nvarchar(6)
As
SELECT DISTINCT
dbo.TabSupplier.[ID #], dbo.TabSupplier.SRAN,
dbo.TabSupplier.JULIAN, dbo.TabAnnex.[ID #] AS ID,
dbo.TabSupplier.Agreement, dbo.TabSupplier.Supplier,
dbo.TabSupplier.Receiver, dbo.TabSupplier.WorkyearCost,
dbo.TabSupplier.Host_ID, dbo.TabAnnex.Categories, dbo.TabAnnex.SubCategory,
dbo.TabAnnex.Support, dbo.TabAnnex.RDescription,
dbo.TabAnnex.RUnits, dbo.TabAnnex.RUnitCost,
dbo.TabAnnex.NRManpower, dbo.TabAnnex.NRDescription,
dbo.TabAnnex.NRUnits, dbo.TabAnnex.NRUnitCost,
COALESCE (dbo.TabAnnex.NRManpower * dbo.TabSupplier.WorkyearCost,
0) AS NRWorkyearCost,
COALESCE (dbo.TabAnnex.RUnits * dbo.TabAnnex.RUnitCost,
0) AS RCost,
COALESCE (dbo.TabAnnex.NRUnits * dbo.TabAnnex.NRUnitCost,
0) AS NRCost, dbo.TabAnnex.Document, dbo.TabAnnex.Billed,
dbo.TabAnnex.Coll, dbo.TabSupplier.Annex_Complete,
dbo.TabSupplier.Status, SUM(dbo.qryAnnex_View.RCost)
AS RCost_Sum,
SUM(dbo.qryAnnex_View.NRWorkyearCost + dbo.qryAnnex_View.NRCost)
AS NRCost_Sum, SUM(dbo.qryAnnex_View.NRManpower)
AS Manpower_sum
FROM dbo.TabSupplier LEFT OUTER JOIN
dbo.qryAnnex_View ON
dbo.TabSupplier.[ID #] = dbo.qryAnnex_View.[ID #] LEFT OUTER JOIN
dbo.TabAnnex ON
dbo.TabSupplier.[ID #] = dbo.TabAnnex.[ID #]
WHERE dbo.TabSupplier.[ID #] = @ID
GROUP BY dbo.TabAnnex.[ID #], dbo.TabSupplier.[ID #],
dbo.TabSupplier.SRAN, dbo.TabSupplier.JULIAN,
dbo.TabSupplier.Agreement, dbo.TabSupplier.Supplier,
dbo.TabSupplier.Receiver, dbo.TabSupplier.WorkyearCost,
dbo.TabSupplier.Host_ID,
dbo.TabAnnex.Categories, dbo.TabAnnex.SubCategory,
dbo.TabAnnex.Support, dbo.TabAnnex.RDescription,
dbo.TabAnnex.RUnits, dbo.TabAnnex.RUnitCost,
dbo.TabAnnex.NRManpower, dbo.TabAnnex.NRDescription,
dbo.TabAnnex.NRUnits, dbo.TabAnnex.NRUnitCost,
COALESCE (dbo.TabAnnex.NRManpower * dbo.TabSupplier.WorkyearCost,
0),
COALESCE (dbo.TabAnnex.RUnits * dbo.TabAnnex.RUnitCost,
0),
COALESCE (dbo.TabAnnex.NRUnits * dbo.TabAnnex.NRUnitCost,
0), dbo.TabAnnex.Document, dbo.TabAnnex.Billed,
dbo.TabAnnex.Coll, dbo.TabSupplier.Annex_Complete,
dbo.TabSupplier.Status
Should I make the form unbound and use ADO code to set up a dynamic Record Source for the form? Then use code to set the UniqueTable property?
The unique table, if I can assign it would be 'TabAnnex'.
If this is the correct way to make it work (making the form updatable), then can someone provide a sample as to how the code would look?
Any assistance in this matter is greatly appreciated.
Thanks,
Cheryl3D
I have a ADP project that I'm working on using SQL Server 2000. I have a form that needs to be available for both entering new records(updatable)and viewing.
Currently, the form is bound to a stored procedure called 'procqryAnnexSummation' as the Record Source. As a result of this type of binding, I can't designate a unique table in the in the UniqueTable property for the form's properties. So while I can view this form just fine,I'm unable to edit the form as it is set to a stored procedure.
The stored procedure called 'procqryAnnexSummation' looks like this:
CREATE Procedure dbo.procqryAnnexSummation
@ID nvarchar(6)
As
SELECT DISTINCT
dbo.TabSupplier.[ID #], dbo.TabSupplier.SRAN,
dbo.TabSupplier.JULIAN, dbo.TabAnnex.[ID #] AS ID,
dbo.TabSupplier.Agreement, dbo.TabSupplier.Supplier,
dbo.TabSupplier.Receiver, dbo.TabSupplier.WorkyearCost,
dbo.TabSupplier.Host_ID, dbo.TabAnnex.Categories, dbo.TabAnnex.SubCategory,
dbo.TabAnnex.Support, dbo.TabAnnex.RDescription,
dbo.TabAnnex.RUnits, dbo.TabAnnex.RUnitCost,
dbo.TabAnnex.NRManpower, dbo.TabAnnex.NRDescription,
dbo.TabAnnex.NRUnits, dbo.TabAnnex.NRUnitCost,
COALESCE (dbo.TabAnnex.NRManpower * dbo.TabSupplier.WorkyearCost,
0) AS NRWorkyearCost,
COALESCE (dbo.TabAnnex.RUnits * dbo.TabAnnex.RUnitCost,
0) AS RCost,
COALESCE (dbo.TabAnnex.NRUnits * dbo.TabAnnex.NRUnitCost,
0) AS NRCost, dbo.TabAnnex.Document, dbo.TabAnnex.Billed,
dbo.TabAnnex.Coll, dbo.TabSupplier.Annex_Complete,
dbo.TabSupplier.Status, SUM(dbo.qryAnnex_View.RCost)
AS RCost_Sum,
SUM(dbo.qryAnnex_View.NRWorkyearCost + dbo.qryAnnex_View.NRCost)
AS NRCost_Sum, SUM(dbo.qryAnnex_View.NRManpower)
AS Manpower_sum
FROM dbo.TabSupplier LEFT OUTER JOIN
dbo.qryAnnex_View ON
dbo.TabSupplier.[ID #] = dbo.qryAnnex_View.[ID #] LEFT OUTER JOIN
dbo.TabAnnex ON
dbo.TabSupplier.[ID #] = dbo.TabAnnex.[ID #]
WHERE dbo.TabSupplier.[ID #] = @ID
GROUP BY dbo.TabAnnex.[ID #], dbo.TabSupplier.[ID #],
dbo.TabSupplier.SRAN, dbo.TabSupplier.JULIAN,
dbo.TabSupplier.Agreement, dbo.TabSupplier.Supplier,
dbo.TabSupplier.Receiver, dbo.TabSupplier.WorkyearCost,
dbo.TabSupplier.Host_ID,
dbo.TabAnnex.Categories, dbo.TabAnnex.SubCategory,
dbo.TabAnnex.Support, dbo.TabAnnex.RDescription,
dbo.TabAnnex.RUnits, dbo.TabAnnex.RUnitCost,
dbo.TabAnnex.NRManpower, dbo.TabAnnex.NRDescription,
dbo.TabAnnex.NRUnits, dbo.TabAnnex.NRUnitCost,
COALESCE (dbo.TabAnnex.NRManpower * dbo.TabSupplier.WorkyearCost,
0),
COALESCE (dbo.TabAnnex.RUnits * dbo.TabAnnex.RUnitCost,
0),
COALESCE (dbo.TabAnnex.NRUnits * dbo.TabAnnex.NRUnitCost,
0), dbo.TabAnnex.Document, dbo.TabAnnex.Billed,
dbo.TabAnnex.Coll, dbo.TabSupplier.Annex_Complete,
dbo.TabSupplier.Status
Should I make the form unbound and use ADO code to set up a dynamic Record Source for the form? Then use code to set the UniqueTable property?
The unique table, if I can assign it would be 'TabAnnex'.
If this is the correct way to make it work (making the form updatable), then can someone provide a sample as to how the code would look?
Any assistance in this matter is greatly appreciated.
Thanks,
Cheryl3D