Hi,
I am using the following syntax to link one form to another.
Private Sub btnOpenPractice_Click()
On Error GoTo Err_btnOpenPractice_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PRACTICE"
stLinkCriteria = "[PracticeName]=" & "'" & Me![GroupName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
GroupName field in the current form links to PracticeName field in the Practice form. The syntax works fine and it does open the Practice form. But when the Practice Name has a quote in it such as "Frank's Practice", it gives me an error "Syntax error (missing operator) in query expression '[PracticeName]='Frank's Practice",
I don't what that means or how to fix it. Can anyone provide me with some guidance on this. Thanks.
I am using the following syntax to link one form to another.
Private Sub btnOpenPractice_Click()
On Error GoTo Err_btnOpenPractice_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "PRACTICE"
stLinkCriteria = "[PracticeName]=" & "'" & Me![GroupName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
GroupName field in the current form links to PracticeName field in the Practice form. The syntax works fine and it does open the Practice form. But when the Practice Name has a quote in it such as "Frank's Practice", it gives me an error "Syntax error (missing operator) in query expression '[PracticeName]='Frank's Practice",
I don't what that means or how to fix it. Can anyone provide me with some guidance on this. Thanks.