Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked subform problem

Status
Not open for further replies.

access8

Programmer
Jun 21, 2002
27
US
I have an Access Project which is used as the front end and SQL Server is used as the back end. I created two forms and I am trying to link the subform to the main form. I created the stored procedure which is as follows:
Alter Procedure storEstimatePaymentLog
(
@ContNo nvarchar(50),
@EstNo nvarchar(5)
)

As
Select tblEstimateComments.CommentNo, tblEstimateComments.ContNo, tblEstimateComments.EstNo, tblEstimateComments.Comments,
tblEstimateComments.CommentDate
FROM tblEstimateComments INNER JOIN
tblEstimatePaymentLog ON
tblEstimateComments.ContNo=tblEstimatePaymentLog.ContNo
WHERE tblEstimateComments.ContNo=@ContNo and tblEstimateComments.EstNo=@EstNo

When opening the main form the subform displays the records but it creates duplicates and I cannot add or delete records from the subform. Is there a way to create a stored procedure where I can modify records in a subform?

Thanks
 
To edit a form (subform) whose recordsource is based on a query that joins tables, you need to set the Recordset Type property of the form to Dynaset (Inconsistent Updates)
 
The only two options it gives me is Updateable Snapshot and Snapshot. The subform's record source is a stored procedure; the records that display on the subform do coincide with the main form however it is creating duplicates and I cannot add/delete records. Is there a way to create a stored procedure or maybe View where I can do this?

Thank :D
 
I GOT IT! Here is the stored procedure I used:
Alter Procedure storEstimatePaymentLog
(
@ContNo nvarchar(50),
@EstNo nvarchar(5)
)

As
Begin
Select * From tblEstimateComments
Where ContNo=@ContNo and EstNo=@EstNo
End


This will allow me to add/delete records + it will not create duplicates! Thanks for your help! :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top