Results 1 to 2 of 2

Thread: CR4 not showing updates

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2004
    Location
    Northern Territory, Australia
    Posts
    61

    CR4 not showing updates

    Hi all, I'm doing a db front-end with vb6, Access'97, coding with DAO3.6, reporting with CR4.6

    Just prior to printing the report, I recalculate a few things and update a yes/no field in the db:
    VB Code:
    1. Private Sub cmdReport_Click()
    2.  
    3.     Dim Interval As Single, varBookmark
    4.    
    5.     With rstShow
    6.         varBookmark = .Bookmark
    7.         .MoveFirst
    8.         Do While Not .EOF
    9.             .Edit
    10.             If IsNull(!lastcheck) Then
    11.                 !due = True
    12.             Else
    13.                 Interval = (DateDiff("d", !lastcheck, Now)) / 7
    14.                 If Interval > !frequency Then
    15.                     !due = True
    16.                 Else
    17.                     !due = False
    18.                 End If
    19.             Debug.Print !Name & " " & !lastcheck & " " & !frequency & " " & !due
    20.             End If
    21.             .Update
    22.             .MoveNext
    23.         Loop
    24.         .Bookmark = varBookmark
    25.     End With
    26.    
    27.     DoEvents
    28.    
    29.     crpReports.Destination = 0
    30.     crpReports.PrintReport
    31.     crpReports.ReportFileName = "FTT.rpt"
    32.  
    33. End Sub
    The debug.print in there shows that the values are updated ("due" is the yes/no field). However, when the report prints, the changes are not reflected. If you print the report again straight away, without making any changes, the changes are shown in the report.

    Why not the first time???

    I've unchecked 'save data with report', checked 'verify on every print', checked 'refresh data on every print' and unchecked 'save data with closed report'. Unless the good lads at Seagate have got another option buried somewhere I think I've got that sorted.

    Any ideas???? Peter

  2. #2

    Thread Starter
    Member
    Join Date
    Aug 2004
    Location
    Northern Territory, Australia
    Posts
    61

    Re: CR4 not showing updates

    I've got around the problem by putting the 'update' code in a separate sub, and calling that from the write subs (lostfocus of text boxes, click event of a combobox).

    I can't see why it didn't work the first way though If anyone knows, I'd like to hear.

    tks, Peter

Posting Permissions

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



Click Here to Expand Forum to Full Width