Record counting on a form

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,

I have a "comments form" that is based off of a query,
which populates a couple of text boxes. On this form, I
have one text box that I am asking the user to add their
comments/notes and then clicking a command button to save
the record and move onto the next record. Let me regress
for a moment... the query, in which the form is sourced
from uses the criteria of only displaying the "comments"
records in the table that are empty... meaning that I want
all records to contain comments. In addition, I would
rather not show the record navigator/selector button on
the bottom of the form. So, in the form's properties box
I have selected "No" to show the record navigator button.

My question is: can I add a text box or something to show
the record number and how many records there are (ex. 1
record out of 10)? Like you would with inserting the page
number (1 page out of 10) or inserting the date? Because
I would like to have the record count shown, but not be
able to move through records using the record navigator.
How would I go about doing this?

A second question: the first text box on the "comments
form" is "classID" which is queried from a registration
table. The "classID" field comes from an auto number
based on a "classlist" table. This "classlist" has the
detailed information about the class...
date,time,location, etc. On the "comments form" I would
like to have perhaps a subform that uses the "classID" on
the "comments" form to show all of the detailed fields
from the "classlist" table. How would I go about doing
this? I can't seem to get this to work.

Thanks for your help. I hope I have written this clear
enough for you to understand my two questions. Thanks
again!!!
 
A bit of code like this in the form's On Current event will show which
record you are on.

txtNavigate is an unbound text box which will display the recordcount

Private Sub Form_Current()
If Me.NewRecord Then
Me!txtNavigate = "New Record"
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!txtNavigate = "Record " & .AbsolutePosition + 1 & " of " &
..RecordCount
End With
End If
End Sub

Question 2:

If you use the subform wizard, it will probably do it for you. To do it
manually, all you need to do is to make sure that ClassID is in both forms
and the the LinkMaster/LinkChild property is set to ClassID in the subforms
property sheet.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top