Your user shouldn't know about your ID field nor should they be filtering on it. So what you ideally want to do is filter based on FirstName and LastName. Correct?
Your user shouldn't know about your ID field nor should they be filtering on it. So what you ideally want to do is filter based on FirstName and LastName. Correct?
When I create a form which the user selects who/what they want to run the report for, I include other details such as ClientID, FirstName, SecondName. I drop into VBA to open this form when the button is clicked. I add this to the criteria in a query so the report filters on the selected record. Code is:
Private Sub Command83_Click()
On Error GoTo Err_Command83_Click
Dim stDocName As String
stDocName = "Training Review:FCs"
DoCmd.SetWarnings False
DoCmd.RunSQL ("INSERT INTO SysTbl_RptAudit (RptName, DateRun, FileName) SELECT '" & stDocName & "' AS Expr1, Now() AS dte, '" & CurrentDb.Name & "' AS FLE;")
DoCmd.SetWarnings True
DoCmd.OpenReport stDocName, acPreview
Exit_Command83_Click:
Exit Sub
Dim strFilter As String
If Len(Me.[COLOR="Blue"]ClientID [/COLOR]& vbNullString) <> 0 Then
strFilter = "[[COLOR="blue"]ClientID[/COLOR]] = " & Me.[COLOR="blue"]ClientID[/COLOR]
End If
DoCmd.OpenReport stDocName, acPreview,,strFilter