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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display a value from textbox/editbox in a report

Status
Not open for further replies.

ridifvx

Programmer
Apr 10, 2003
34
ID
Hi..
i have a problem to get a value/text from a textbox or editbox and display it in a reports (field expression control) using expression builder..is there anyone can give me an expression builder code to solve this problem..plz

i'm sorry i ask this because i can't find the solutions in a help or books :(

thanks in advance..
 
You'll need a direct reference to the control on the form.

If your form is called goFormOne and it contains a
textbox named txtOne which you want to display the
contents of on a report, enter this in the report controls
expression:

goFormOne.txtOne.value


You can also use the ActiveForm object, _screen.forms(x),
or any number of indirect references to accomplish the above.

If your forms use private datasessions, you'll need to
switch to the forms datasessionid before running your report.

If you are using multiple forms which you want values
from, you'll be better off storing the values in public or
private(within the report scope) variables.


Darrell
 
Ridifvx,

Darrell's suggestions should work. Another possibility would be to copy the textbox value into a private variable (do that in the form containing the textbox), then call the report:

PRIVATE pcMyValue
pcMyValuye = thisform.Text1.Value
REPORT FORM MyReport TO PRINTER

The report can then simply reference pcMyValue.

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike,

Welcome back! Haven't seen you around. <g>

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Thanks.. u help me a lot :)
BTW after i used it. It's work fine at the VFP environment but when i tried to compile this project (become *.exe)
when i clicked the exe one an error occurs like this:

1. Table is read only so i can't add a records or something help!!! how can i to make the table is not read only :(

2. The worst one is when i clicked a button to show a report..FVP said this
Object &quot;name&quot; is not found (Error 1923)..
in reports i put a lot value which come from theform &quot;name.frx&quot;

3. One morething can i make setup file using with install shield LE 4 FVP 8.0 i always fail any suggestion

i know i'm stupid..but anybody help me btw im using FVP 8.0

sorry 4 my english
Thanks
 
ridifvx

1. Table is read only so i can't add a records or something help!!! how can i to make the table is not read only :(

Make sure that the table in question is in your project but not included in the exe. Right-mouse on the table in the project manager and select &quot;exclude&quot;.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top