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

Displaying number of records in a table on a button. 2

Status
Not open for further replies.

Dherrera

Programmer
Mar 22, 2004
86
US
i want to display the number of records in a table on a button. the reason for this is that the button will take the user to a notes form and i want the button to let them know if there are any records in the table. but it must show only the total number for the record that it corresponds to. so if record id # 1 has 5 note entries in it i want the button to show that number.

any ideas?

thanks
 
How are ya Dherrera . . . . .

Use the [blue]DCount[/blue] function & the [blue]Caption[/blue] property of the button.

Calvin.gif
See Ya! . . . . . .
 
Hi Dherrera,

try using the DCount function, i.e.
Code:
me!btnOpenNotes.Caption = DCount("myField", "myTable", "ID = " & me.myControlToSelectID.Value)
You dont say where you get the id from but swap myField for any valid field in myTable, presumably your notes table, and change myControlToSelectID for the control name which gives you your id number...

HTH, Jamie
FAQ219-2884
[deejay]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top