On 27 Apr 2004 00:12:01 GMT, Lumpierbritches wrote:
Private Sub cmdOpenAnimal_Click()
On Error GoTo Err_cmdOpenAnimal_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAnimal"
stLinkCriteria = "[AnimalID]=" & "'" & Me![AnimalID] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdOpenAnimal_Click:
Exit Sub
Err_cmdOpenAnimal_Click:
MsgBox err.Description
Resume Exit_cmdOpenAnimal_Click
End Sub
Your problem is you have a single quote in the criteria field....
[AnimalID]=BLANK'S MOLLIE-PRINCE BRUISER-3/14/2004-03
So your Where clause is failing when it hits the ' in Blank's.
Try it this way (instead of using & "'" etc.)
stLinkCriteria = "[AnimalID]=" & chr(34) & Me![AnimalID] & chr(34)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.