Results 1 to 4 of 4

Thread: Report Text Box

  1. #1
    Join Date
    Feb 2003
    Posts
    2

    Unanswered: Report Text Box

    I have a function in the OnLoad event of a report that returns a value.

    I am trying to return the value to a text box but when the code is executed I get the error

    Runtime error -2147352567 (80020009)
    You can't assign a value to this object.

    Below is the code, can anybody tell me if what I am trying to do is possible and if so where am I going wrong.

    Thank in anticipation

    Steve Jenkins

    Public Sub ReportReturnScenarioName()

    ' Retrieves the scenario name for the current results set

    Dim db As Database
    Dim rsScenario As RecordSet
    Dim ScenarioName As String

    Set db = CurrentDb

    Set rsScenario = db.OpenRecordset("CurrentResults", dbOpenDynaset)

    If rsScenario.RecordCount > 0 Then
    rsScenario.MoveFirst
    ScenarioName = rsScenario.Fields("ScenarioName").Value
    rsScenario.Close

    Reports![TransactionVolumes].SName = ScenarioName
    Else
    Reports![TransactionVolumes].SName = "No Available Imported Data"
    End If

    End Sub

  2. #2
    Join Date
    Jan 2003
    Posts
    126
    Try this:

    Reports![TransactionVolumes].SName.value = ScenarioName

    Add the .value

    Ken

  3. #3
    Join Date
    Feb 2003
    Posts
    2
    Thanks for your help

  4. #4
    Join Date
    Jan 2003
    Posts
    126
    Hope it worked for you! Glad I could help!

    Ken

Posting Permissions

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