Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying a text box in a report using VB 1

Status
Not open for further replies.

falcon7a

Programmer
Jan 26, 2005
5
US
I am trying to modify the contents of a report based on the values in a query table that i populate through a form.

I tried to do that by the following code in the report:

Private Sub Report_Open(Cancel As Integer)
Dim Text19 As TextBox

If (something)
Me.Text19 = Yes
Else me.Text19 = No

End Sub

However, I get an error when I run the report. The error is: "You can't assign a value to this object".

I tried adding the code above to the Report_Activate sub but that doesn't add anything to the report. My plan is to add a sql string in the report to print out the word "yes" in a text box if a certain condition is met in a query table.

Thanks for your help in advance.
 
Try it in the Detail Format section of the report and text19 should be unbound (have no control source).


You can also use Select Case:

Select Case me.text19

Case is = "Yes"
Do something

Case is = "No"
Do something

End Select


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top