Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Mar 2001
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change field value after printing (Access 2000)

    After printing a report, I need to change the value of a yes/no field (Completed) in a table to true. I'm using Access 2000 with Win2000. I've tried the following: In the report design view, properties, on close - used expression builder to say Completed=true. We've also used the code builder for the report onclose property to say table name.Completed=true.

    Results we got were:
    On the report design view expression builder, we get the error that the object doesn't contain the automation object.

    In the code builder, we get a compile error.

    Any help will be appreciated.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Change field value after printing (Access 2000)

    What you could do is put the following code into the OnClose event:
    Dim strSQL as string
    strSQL = "UPDATE Tablename SET Completed = True WHERE somecondition"
    DoCmd.RunSql strSql

    Substitute your tablename and somecondition.

    HTH
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •