Display record number in text box

  • Thread starter Thread starter Fay via AccessMonster.com
  • Start date Start date
F

Fay via AccessMonster.com

I have a form. I typed in a text box control property:
=[Form].[CurrentRecord]

I type this exactly , but it gives me the error of #Name? in the text box.

I'm just trying to displays the record number just like it's doing in the
navigation buttons.. it displays that it's for instance 5 of 13. I'm trying
to get a text box to display the number 5 for the 5th record that the form is
on.

Thanks,
Fay
 
SelTop returns the current record number, so you could put:
=SelTop
in the textbox's control source. However, this won't update automatically,
so you'll have to requery the textbox. In the form's OnCurrent event, type:

Me.MyTextBox.Requery

HTH,
Barry
 
See:
http://www.lebans.com/rownumber.htm
Rownumber.zip is a database containing functions for the automatic row
numbering of Forms, SubForms and Queries.

Updated Oct. 13 by Allen Browne. Includes error handling and cleaned code.



Here's an update to the Serialize function by Peter Schroeder:

Good to hear. FWIW, here's the version I came up with today, based off of
your code and Ken's(Getz) suggestion, with a few changes:


Function Serialize(qryname As String, keyname As String, keyvalue) As Long

Dim rs As Recordset


On Error GoTo Err_Serialize

Set rs = CurrentDb.OpenRecordset(qryname, dbOpenDynaset, dbReadOnly)

rs.FindFirst Application.BuildCriteria(keyname, rs.Fields(keyname).Type,
keyvalue)

Serialize = Nz(rs.AbsolutePosition, -1) + 1


Err_Serialize:

rs.Close

Set rs = Nothing

End Function


Peter Schroeder


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
U¿ytkownik "Fay via AccessMonster.com said:
I have a form. I typed in a text box control property:
=[Form].[CurrentRecord]

I type this exactly , but it gives me the error of #Name? in the text box.

I'm just trying to displays the record number just like it's doing in the
navigation buttons.. it displays that it's for instance 5 of 13. I'm trying
to get a text box to display the number 5 for the 5th record that the form is
on.

Thanks,
Fay

============================================================================
================
FULL LEGAL SOFTWARE !!!
Games, video, program, image, chat, questbook, catalog site, arts, news,
and...
This site it is full register and legal software !!!
Please download and you must register software !!!

PLEASE REGISTER SOFTWARE:
http://www.webteam.gsi.pl/rejestracja.htm
DOWNLOAD LEGAL SOFTWARE:
http://www.webteam.gsi.pl

Full question and post: http://www.webteam.gsi.pl

Contact and service and advanced technology:
http://www.webteam.gsi.pl/kontakt.htm
FAQ: http://www.webteam.gsi.pl/naj_czesciej_zadawane_pytania.htm

Please add me URL for you all site and search engines and best friends !!!

Me site:
SERWIS WEBNETI: http://www.webneti.gsi.pl
PORTAL WEBTEAM: http://www.webteam.gsi.pl
LANGUAGE: http://www.webneti.cjb.net
============================================================================
================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top