Hello everybody,

sorry for asking (this is probably pretty simple ) but I am new to access and can't really figure this one out.

I have tried to make an address book, and I want to be able to use a combination of the firstname (FName) and lastname (LName) to match a search request. I have tried to alter the code to include both the FName and the LName post but I only get one of these two errors:
1) syntax error (missing operator) in query or
2) type mismatch..

Can anyone help me where to add the code for [LName] to avoid these problems?
Thanks in advance,
//Anders

--- (the code below pics the information based only on the first name.. which means that if 2 ppl in my database has the same first name the information gets corrupt) ---


Option Compare Database

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Address Group"

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

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub
Private Sub namesel_Click()
On Error GoTo Err_namesel_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Address Group"

stLinkCriteria = "[FName]=" & "'" & Me![FName] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_namesel_Click:
Exit Sub

Err_namesel_Click:
MsgBox Err.Description
Resume Exit_namesel_Click

End Sub
Private Sub Command6_Click()
On Error GoTo Err_Command6_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Address Group"

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

Exit_Command6_Click:
Exit Sub

Err_Command6_Click:
MsgBox Err.Description
Resume Exit_Command6_Click

End Sub