I have created a report that has a list of individual's names and have written code so that I can click on a person's last name and it will take you to their detailed info, but it brings up all the records who share the same last name so I added a field showing the last 4 of the social security number to make it more precise. However, when I try to use similar code it just links me to a blank form. I'm assuming the problem is that the form shows the whole SS# while the report just shows the last 4, how do i correct this? Below is the code I have written that gives me the blank form:
Private Sub Last_4_Click()
DoCmd.OpenForm "frmDataEntry", _
WhereCondition:="Social = '" & Me.Last_4 & "'"
End Sub
Private Sub Last_4_Click()
DoCmd.OpenForm "frmDataEntry", _
WhereCondition:="Social = '" & Me.Last_4 & "'"
End Sub