If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update a table and close a form after a report runs...
After I run and then close a report I want a checkbox in
Acknowledgement table to update...the table does show the checkbox updated. ....but after the report closes I am brought back to the form the checkbox is on...it isn't updated...it will only be checked off after I leave that form and come back again! Do I just add code to close that form...or is there another way to make it show a check immediately? ....and where in the sub below would it go...thanks! Private Sub Report_Close() Dim db As Database Dim strSQL As String ' Return reference to current database. Set db = CurrentDb ' Create SQL string. strSQL = "UPDATE dbo.Acknowledgement SET RefereeReceiptLetter = True " _ & "WHERE RefereeReceiptLetter = False " ' Run action query. db.Execute strSQL ' Return number of records updated. Debug.Print db.RecordsAffected Set db = Nothing End Sub |
Thread Tools | |
Display Modes | |
|
|