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

Adding a Count to any form... 2

Status
Not open for further replies.

mdmarney

IS-IT--Management
Jan 16, 2003
68
US
How can I add a count of a total number of records to a form? I would like to know users inputting data to know how many total entries have been made.
 
Hi,

Try this on form Current:

Set rs = CurrentDb.OpenRecordset("Select * from TableName")
rs.MoveLast
Me.TextBoxName = rs.RecordCount


Good Luck
Do It Well, Or Don't.
 
That Worked Great. If I may...
How do I add a WHERE statement that selects only those records matching the field in the main form?
I tried "Select * from tbl_Attendants where Parish or Group ID = tbl_Groups_and_Diocese.Parish or Group ID"
I think the "tbl_Groups_and_Diocese.Parish or Group ID" part needs to match the selcted field in the main form, but maybe I'm not referencing it correctly. Help!
 
if both are numbers

"Select * from tbl_Attendants where Parish = " & me!parish & " or Group ID = " & me!Group ID

if parish is a string then

"Select * from tbl_Attendants where Parish = '" & me!parish & "' or Group ID = " & me!Group ID

if both are strings

"Select * from tbl_Attendants where Parish = '" & me!parish & "' or Group ID = '" & me!Group ID & "'"

and finally only group_id is string

"Select * from tbl_Attendants where Parish = " & me!parish & " or Group ID = '" & me!Group ID & "'"


"What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top