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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordset used to be updatable - not anymore...(ADP)

Status
Not open for further replies.

sk1hotpepr

Technical User
Jul 11, 2003
63
US
I'm having trouble trying to figure out why a recordset is no longer updatable on a form I'm using. The table has a primary key, so that's not it. I haven't done anything different. Can a user entering information somehow create an error that would no longer make a recordset editable?

Here is my recordsource for the form if it will help.
Code:
SELECT     ProjectBidInfo.ProjectNumber, ProjectBidInfo.GSFAdd, ProjectBidInfo.GSFRenov, ProjectBidInfo.SiteAcreage, ProjectBidInfo.ProgBldg, 
                      ProjectBidInfo.ProgSite, ProjectBidInfo.ProgMech, ProjectBidInfo.ProgElec, ProjectBidInfo.ProgPlb, ProjectBidInfo.ProgAsb, ProjectBidInfo.SDSite, 
                      ProjectBidInfo.SDBldg, ProjectBidInfo.SDMech, ProjectBidInfo.SDElec, ProjectBidInfo.SDPlb, ProjectBidInfo.SDAsb, ProjectBidInfo.CDBldg, 
                      ProjectBidInfo.CDSite, ProjectBidInfo.CDMech, ProjectBidInfo.CDElec, ProjectBidInfo.CDPlb, ProjectBidInfo.CDAsb, ProjectBidInfo.BidBldg, 
                      ProjectBidInfo.BidSite, ProjectBidInfo.BidElec, ProjectBidInfo.BidMech, ProjectBidInfo.BidPlb, ProjectBidInfo.DDSite, ProjectBidInfo.BidAsb, 
                      ProjectBidInfo.DDBldg, ProjectBidInfo.DDMech, ProjectBidInfo.DDElec, ProjectBidInfo.DDPlb, ProjectBidInfo.DDAsb, SUM(ProjectContractor.ActBid) 
                      AS MyBid
FROM         ProjectBidInfo LEFT OUTER JOIN
                      ProjectContractor ON ProjectBidInfo.ProjectNumber = ProjectContractor.ProjectNumber
GROUP BY ProjectBidInfo.ProjectNumber, ProjectBidInfo.GSFAdd, ProjectBidInfo.GSFRenov, ProjectBidInfo.SiteAcreage, ProjectBidInfo.ProgBldg, 
                      ProjectBidInfo.ProgSite, ProjectBidInfo.ProgMech, ProjectBidInfo.ProgElec, ProjectBidInfo.ProgPlb, ProjectBidInfo.ProgAsb, ProjectBidInfo.SDSite, 
                      ProjectBidInfo.SDBldg, ProjectBidInfo.SDMech, ProjectBidInfo.SDElec, ProjectBidInfo.SDPlb, ProjectBidInfo.SDAsb, ProjectBidInfo.CDBldg, 
                      ProjectBidInfo.CDSite, ProjectBidInfo.CDMech, ProjectBidInfo.CDElec, ProjectBidInfo.CDPlb, ProjectBidInfo.CDAsb, ProjectBidInfo.BidBldg, 
                      ProjectBidInfo.BidSite, ProjectBidInfo.BidElec, ProjectBidInfo.BidMech, ProjectBidInfo.BidPlb, ProjectBidInfo.DDSite, ProjectBidInfo.BidAsb, 
                      ProjectBidInfo.DDBldg, ProjectBidInfo.DDMech, ProjectBidInfo.DDElec, ProjectBidInfo.DDPlb, ProjectBidInfo.DDAsb

[\code]
 
Thanks for writing back, I swore I was able to enter information at one point. But I got rid of the "group by" in my record source. I had to add a subform just to pick up that summed field since I didn't need it to be updatable anyway and it seems to be working now. I don't know if there's a better way than that.

Sherry
 
I can't conceive of why you'd need to group by so many columns. Use a derived table to get the sum per project contractor:
Code:
SELECT
   B.*,
   MyBid
FROM
   ProjectBidInfo B
   LEFT JOIN (
      SELECT ProjectNumber, MyBid = SUM(C.ActBid) FROM ProjectContractor C GROUP BY ProjectNumber
   ) S ON B.ProjectNumber = S.ProjectNumber
If you want less than all columns, then you can list them. the only ones that actually need the B. prefix is ProjectNumber because this also exists in the derived table S (which I chose for Sum).
 
Oh... a side effect of this is that the recordset will be updatable because the group by is not in the main query. (You might have to set the "unique table" property or whatever it is to ProjectBidInfo.) You won't be able to edit the sum column, though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top