Results 1 to 2 of 2
  1. #1
    boywonder is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Dec 2010
    Location
    Memphis, TN
    Posts
    60

    You can't assign a value to this object

    I keep getting a "-2147352567You can't assign a value to this object." when it runs the below code at the Me.PIFCount = h area.


    Else
    'Count records per Customer Contract number 09/08/2011
    rsCustTotals.MoveFirst
    rsCustTotals.MoveLast
    M = rsCustTotals.RecordCount
    rsCustTotals.MoveFirst
    Do While Not rsCustTotals.EOF
    If rsCustTotals![Trans Type] = "N" Then
    CustAmount = CustAmount + rsCustTotals![Loan Amount]
    Else

    End If
    rsCustTotals.MoveNext
    Loop
    End If
    rsQry.MoveNext
    Loop
    End If

    If CustCount > 0 Then
    Me.PIFCount = h
    Else
    Me.PIFAmount = 0
    End If
    If CustAmount > 0 Then
    Me.PIFAmount = g
    Else
    Me.PIFAmount = 0
    End If

    I'm using Access 2003 report to calculate and add total to a textbox on the report. What am I doingggggggggg wrong?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Cannot use code to set the value of a textbox on an open report. Once a report is rendered, it's RecordSet is committed. Can't change ControlSource property of any controls.

    Pass filter criteria to the report then use report Grouping & Sorting with summary calcs.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-03-2011, 07:01 PM
  2. Replies: 2
    Last Post: 07-13-2011, 06:23 AM
  3. Replies: 1
    Last Post: 08-05-2010, 12:11 PM
  4. Replies: 3
    Last Post: 04-15-2010, 09:43 AM
  5. Replies: 3
    Last Post: 03-30-2010, 01:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums