0
votes

I would like for my update query to only update current record in form

This is what i currently have:

Private Sub Form_AfterUpdate()

DoCmd.RunSQL "UPDATE RO_REALESTATE_AM_PROJECT_STATUS1 INNER JOIN tblEast ON RO_REALESTATE_AM_PROJECT_STATUS1.PROJ_ID=tblEast.RO_REALESTATE_AM_PROJECT_STATUS_PROJ_ID SET RO_REALESTATE_AM_PROJECT_STATUS1.CURRENT_STATUS = [tblEast]![CURRENT_STATUS], RO_REALESTATE_AM_PROJECT_STATUS1.BUDGET_ISSUES = [tblEast]![BUDGET_ISSUES], RO_REALESTATE_AM_PROJECT_STATUS1.SCHEDULE_DELAYS = [tblEast]![SCHEDULE_DELAYS], RO_REALESTATE_AM_PROJECT_STATUS1.POTENTIAL_ISSUES = [tblEast]![POTENTIAL_ISSUES], RO_REALESTATE_AM_PROJECT_STATUS1.NTP_DESIGN = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_NTP_DESIGN], RO_REALESTATE_AM_PROJECT_STATUS1.NTP_CONSTRUCTION = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_NTP_CONSTRUCTION], RO_REALESTATE_AM_PROJECT_STATUS1.SUBSTANTIAL_COMPLETION = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_SUBSTANTIAL_COMPLETION], RO_REALESTATE_AM_PROJECT_STATUS1.SCHOOL_OCCUPANCY = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_SCHOOL_OCCUPANCY]"

End Sub

This updates 17 records but I would only like to update the record that is displayed in my form.I make my selection from a combo box. Help.

1

1 Answers

0
votes

In case this helps anyone,

Here is the solution

DoCmd.RunSQL "UPDATE RO_REALESTATE_AM_PROJECT_STATUS1 INNER JOIN tblEast ON RO_REALESTATE_AM_PROJECT_STATUS1.PROJ_ID = tblEast.RO_REALESTATE_AM_PROJECT_STATUS_PROJ_ID SET RO_REALESTATE_AM_PROJECT_STATUS1.CURRENT_STATUS = [tblEast]![CURRENT_STATUS], RO_REALESTATE_AM_PROJECT_STATUS1.BUDGET_ISSUES = [tblEast]![BUDGET_ISSUES], RO_REALESTATE_AM_PROJECT_STATUS1.SCHEDULE_DELAYS = [tblEast]![SCHEDULE_DELAYS], RO_REALESTATE_AM_PROJECT_STATUS1.POTENTIAL_ISSUES = [tblEast]![POTENTIAL_ISSUES], RO_REALESTATE_AM_PROJECT_STATUS1.NTP_DESIGN = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_NTP_DESIGN], RO_REALESTATE_AM_PROJECT_STATUS1.NTP_CONSTRUCTION = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_NTP_CONSTRUCTION], RO_REALESTATE_AM_PROJECT_STATUS1.SUBSTANTIAL_COMPLETION = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_SUBSTANTIAL_COMPLETION], RO_REALESTATE_AM_PROJECT_STATUS1.SCHOOL_OCCUPANCY = [tblEast]![RO_REALESTATE_AM_PROJECT_STATUS_SCHOOL_OCCUPANCY] Where RO_REALESTATE_AM_PROJECT_STATUS1.PROJ_ID= " & Me.Combo77 & ";"