I have a form that prompts the user to select criteria so they can run their own custom queries. On that form is a button that allows them to launch a data entry form on just the records that they queried for. I'm trying to write 'stLinkCriteria' statement so that the form to be opened will be filtered correctly but I'm running into problems. Basically I want to write a ' = Like OF* or like GB*' statement so that all records with 'OF' or 'GB' in the control field are returned. Here is my code, with the problem area bolded...any ideas?:
Code:
Private Sub ENCL_DS_QB_Click()
On Error GoTo Err_ENCL_DS_Form_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Enclosures TRM_QB"
[B]stLinkCriteria = "[Unique Tag] Like 'GB*' or Like 'OF*'"[/B]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ENCL_DS_Form_Click:
Exit Sub
Err_ENCL_DS_Form_Click:
MsgBox Err.Description
Resume Exit_ENCL_DS_Form_Click
End Sub
Last edited: