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

Keep the variable value from changing with each record

Status
Not open for further replies.

MaryKay1

IS-IT--Management
May 16, 2007
13
US
How can I keep the variable value from changing with each record? Please help
 
I am trying to keep my first record SubNo (Subscriber number in the table) in a variable but only the first record to use it for reference later in the report. Problem is that it gets change continuously with every record SubNo.
Basically I need to know in which section of report (or a method) I can put my variable that will stay constant, I even put it in the header even so in the report show the first one on the top when I tried to use it later I realize it was changed and had the latest record SubNo
 
If it's in the report header it won't change.

You should post your formula.

But anyway, place this in the report header:

whileprintingrecords;
numbervar SubNo := {table.subno};

Then anywhere in the report youcan display the value using:

whileprintingrecords;
numbervar SubNo

I assumed that it is a number here because you said so, stating data types is also important when dealing with 'puter stuff and stuff...

If it isn't a number, use:

whileprintingrecords;
stringvar SubNo := {table.subno};

Then anywhere in the report you can display the value using:

whileprintingrecords;
stringvar SubNo

-k
 
Thanks a lot for your help while I was waiting for your response I did the following that worked, basically is the same method. Suppressing the box is one extra step to make sure no other interference.

I created a Text Box in the header and opened it for format clicking on suppress code box and put the following; (if it is working correctly) it is suppressing the box just after variable R value is set. I call the variable in other part of my program and it is keeping the value.

stringVar R;

R := Right({Table9.SubNo},1); //Getting the last character into the variable

IIF (R<>"",True,False) //Suppress the box



Once again I thank you for your time and help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top