J
Jessica
I HAVE A FORM CALLED SEARCH. WHERE I COULD SEARCH BY CRITERIA(CLIENTID OR
NAME) iN THIS FORM I ALSO HAVE A SEARCH COMMOND WHEN I CLICK ON THIS BUTTON I
WANT IT TO TAKE ME TO THE CLIENTS FORM, BUT I WOULD LIKE IT TO GIVE ME THE
INFO. ONLY FOR THE RECORD I SEARCH FOR NOT ALL OF THE RECORDS. I CURRENTLY
HAVE THE FOLLOWING CODE
Private Sub Command49_Click()
On Error GoTo Err_Command49_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Clients Form"
stLinkCriteria = "[ClientID]=" & "'" & Me![ClientID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command49_Click:
Exit Sub
Err_Command49_Click:
MsgBox Err.Description
Resume Exit_Command49_Click
End Sub
wHICH GIVES ME THE CORRECT RECOR, BUT IF I SEARCH BY LASTnAME I WANT IT TO
GIVE ME THE SPECIFIC LAST NAME. wHAT CAN I ADD TO THIS CODE SO WHEN I TYPE IN
A LAST NAME IT GIVES IT TO ME. WHAT DO I NEED TO ADD TO THE CODE
NAME) iN THIS FORM I ALSO HAVE A SEARCH COMMOND WHEN I CLICK ON THIS BUTTON I
WANT IT TO TAKE ME TO THE CLIENTS FORM, BUT I WOULD LIKE IT TO GIVE ME THE
INFO. ONLY FOR THE RECORD I SEARCH FOR NOT ALL OF THE RECORDS. I CURRENTLY
HAVE THE FOLLOWING CODE
Private Sub Command49_Click()
On Error GoTo Err_Command49_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Clients Form"
stLinkCriteria = "[ClientID]=" & "'" & Me![ClientID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command49_Click:
Exit Sub
Err_Command49_Click:
MsgBox Err.Description
Resume Exit_Command49_Click
End Sub
wHICH GIVES ME THE CORRECT RECOR, BUT IF I SEARCH BY LASTnAME I WANT IT TO
GIVE ME THE SPECIFIC LAST NAME. wHAT CAN I ADD TO THIS CODE SO WHEN I TYPE IN
A LAST NAME IT GIVES IT TO ME. WHAT DO I NEED TO ADD TO THE CODE