dcount of filtered form

J

John

I have a form that opens a second form that is filtered against the field
MR# code from the form wizard as follows:
Private Sub cmdOpenMr_Click()
On Error GoTo Err_cmdOpenMr_Click
'DoCmd.GoToRecord , , acNewRec
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAdmissionDetails"

stLinkCriteria = "[MR#]=" & "'" & Me![MR#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_cmdOpenMr_Click:
Exit Sub

Err_cmdOpenMr_Click:
MsgBox Err.Description
Resume Exit_cmdOpenMr_Click

I would simply like to have an unbound text box on the second form showing
the number of records that have been filtered, but having a difficult time
getting the syntax correct.

Thanks for you help
 
K

Ken Snell

Try this as that textbox's control source:

=DCount("*", [RecordSource], [Filter])
 

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

Similar Threads


Top