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

Displaying record number in a continuous subform? 1

Status
Not open for further replies.

huskerdon

Programmer
Aug 26, 2002
67
US
Hi,

I know on a report, you can set a text box Control Source to "= 1", and RunningSum property to "Over Group". This will display the individual record number on the report.

Is there a way to do the same on a subform? I'm using a Continuous form in the subform, and want each record to be numbered. I can probably do it with code, but wonder if there is a quick way to do it without code. Any help will be greatly appreciated.

Thanks,

huskerdon
 
How are ya huskerdon . . . . .

I'm confused . . . . How is it that the [blue]Navigation Control[/blue] doesn't give you what you want?

cal.gif
See Ya! . . . . . .
 
TheAceMan,

Thanks for that suggestion, however I'm really limited in the area I have, so I don't want to use record selectors or navigation buttons on this subform.

The way it was designed works perfectly - with vertical scroll bars on the right, and when you click on it, it moves forward one record at a time. I would just like the user to be able to see what record number it is. The continuous subform only shows 3 records at a time, but there could be up to 10 or more total records. (When I tested it with record selectors and navigation buttons, it advanced the record, but when I got past record #3, the selected record was not visible.)

I guess I could add a field in the recordsource's query to show the record number. Does anybody know how to do this??

Thanks a lot!
 
In the header or footer section of the subform, add a label and in the Current event procedure of the subform add sommething like this:
theLabelName.Caption = Me.Recordset.AbsolutePosition + 1 & " of " & Me.Recordset.RecordCount

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
ZmrAbdulla,

Thanks for pointing me to the KB article. That did the trick! I wanted the record number to be there when I scroll down to see the other records, and not by having to click on an individual record. That's why code on the Form Current event wouldn't work for what I needed.

I couldn't figure out how to add a "record number" field to the underlying query, so this did what I wanted. As the article states, the keyvalue parameter MUST be a unique value. I made the mistake, at first, of using the value of which there were multiples. When that didn't work, I realized that I had to use a unique ID value.

Thanks a lot,

huskerdon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top