Results 1 to 10 of 10
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: assign a value to a textbox on an unbound report

    Hi,

    I am trying to assign a value to a textbox on an unbound report
    Me!Text8 = "X"
    but it's giving me this error message:
    Run-time error ‘2448’
    You can’t assign a value to this object.

    Where is the error and how can I get around it?

    Thank you much!!

  2. #2
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    As far as to my knowledge you cant add any information what so ever to a report. So you will need to put something in that txtbox before it goes on the report (like a query or something)
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by JSThePatriot
    As far as to my knowledge you cant add any information what so ever to a report. So you will need to put something in that txtbox before it goes on the report (like a query or something)
    Actually you can ... BUT it has to be done within the Detail_Format section ....

    But then of course there are labels ... Hmmmm .... What a concept

  4. #4
    Join Date
    May 2002
    Posts
    395

    assigning a value in an unbound report

    Thanks both of you for your replies.

    Hi Owen,

    I did create the controls(textbox & label) in the Detail section of the report. Same error message is popping up for both controls. It should be a super simple task, why aren't they working? Could it be the sytax? I tried a different way of referencing the control but still doesn't work:
    If Reports!test!Label9 = "deflash" Then
    MsgBox " Hi"
    End If

    I really needs get this working! Thank you.

  5. #5
    Join Date
    May 2002
    Posts
    395

    referencing the control on the report

    When I tried referencing the control on the report
    Reports!test!Label9 = "deflash"

    This is error message I received"
    run-time error '438'
    Object doesn't support this property or method

    Thanks!

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: referencing the control on the report

    Originally posted by alicejwz
    When I tried referencing the control on the report
    Reports!test!Label9 = "deflash"

    This is error message I received"
    run-time error '438'
    Object doesn't support this property or method

    Thanks!
    WHERE are you trying to reference the control from? You have to do this from within the report itself ...

  7. #7
    Join Date
    May 2002
    Posts
    395

    assign a value to the control on the report

    Hi,

    Yes, I tried to assign a value to the control of the report in the report in Report Open event. The controls are created in the Detail section of the report. The report is unbound.

    Private Sub Report_Open(Cancel As Integer)
    Me!Check2 = true
    'you can't assign value to this object

    Report!test!Check2 = True
    ' you can't assign value to this object
    Reports!test!Label9 = "deflash"
    'object doesn't support this property or method

    End Sub

    It works with the form. What did I miss in the report? This is very frustrating.

    I really appreciate your help.

  8. #8
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: assign a value to the control on the report

    Originally posted by alicejwz
    Hi,

    Yes, I tried to assign a value to the control of the report in the report in Report Open event. The controls are created in the Detail section of the report. The report is unbound.

    Private Sub Report_Open(Cancel As Integer)
    Me!Check2 = true
    'you can't assign value to this object

    Report!test!Check2 = True
    ' you can't assign value to this object
    Reports!test!Label9 = "deflash"
    'object doesn't support this property or method

    End Sub

    It works with the form. What did I miss in the report? This is very frustrating.

    I really appreciate your help.
    Try rereading my 1st posting ...

  9. #9
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    I think what Owen is pointing out is that Labels so not have a "Value" property (which is the assumed property when you don't specify a property).

    Hence, when you try to assign something to a property the control doesn't have, it respons with "Object doesn't support that" error.

    To change the displayed content of a Label, use the Caption property.

    A reliable way to change the content of text boxes (to make them dynamically respond to the data of the current record as the report generates) is to use a function as the recordsource of the text box and place the function in the code behind the report.

  10. #10
    Join Date
    May 2002
    Posts
    395

    assigning a value

    Originally posted by tcace
    I think what Owen is pointing out is that Labels so not have a "Value" property (which is the assumed property when you don't specify a property).

    Hence, when you try to assign something to a property the control doesn't have, it respons with "Object doesn't support that" error.

    To change the displayed content of a Label, use the Caption property.

    A reliable way to change the content of text boxes (to make them dynamically respond to the data of the current record as the report generates) is to use a function as the recordsource of the text box and place the function in the code behind the report.
    Hi tcace,
    Thank you so much for your explanations.
    I understand each control inherits certain properties and understand why the Object doesn't support .. display when this error occurred. I guess I was attempt to assign a value to the textbox: Reports!test!Text8.Value = "X". I still don't know why I couldn't assign a avalue to the textbox. Adding Caption property to Label does work.
    Thanks for your other suggestion in using function as the recordsource in the control. I will keep that in mind.

    Have a great day!

Posting Permissions

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