A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update a table and close a form after a report runs...



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2004, 06:59 PM
Jacqueline
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.