How do I set up a variable for the current record number?
To set an variable value equal to the current record number, you only need to use the Equal sign
Code:
SELECT MyData
nThisRecNo = RECNO() && the variable now equals the current record number
BUT MORE IMPORTANTLY......
My record number is a computer generated field on my form/screen.
OK, lets get some terminology straight.
Form Textbox entries are not necessarily automatically written to a data table. They may be done so, but not necessarily.
If not, then you do NOT have a record containing the Form variable data. So with no record, you can have no record number.
You might want to use a command SET STEP ON just before the REPORT FORM command.
That new command will force the program to halt execution and automatically open the TRACE Window on the code.
At that point go to the Command Window and type BROWSE NORMAL
That will open a browse window to look at the data table which will be used by the immediately next REPORT FORM command.
Look in the Browse window to see where the cursor is (this is the current record). If this shows the data from your Form, then fine - use the NEXT 1 option in your REPORT FORM command.
If you cannot find your Form data at all, then it has not been written to the data table that the Report Form will run with.
Try that and get back to us.
Good Luck,
JRB-Bldr