Query Criteria (QBF)

  • Thread starter Thread starter gr
  • Start date Start date
G

gr

Hi,

I have a field Remarks. In this field usually a user types
a message or a note to another user.
ex.
Remarks: "Roger don't forget to call the client. Max, pls
by more products B"

I need a query which finds the names of the people so
Roger can query all his messages

I have an unbound combobox "Wer" which lists all the
names. I just need to be able to tell the query which name
to look in the Remarks string.

I have tried with Like, but not working...
This is my code...
...
.....
Case 5
' Wer
Dim cmbWer As ComboBox
Set cmbWer = Forms!frmFilters!ctlName
Dim strWer As String
strWer = cmbWer.Column(0)
'THIS IS ALL THE DIFFERENT WAYS I HAVE TRIED..NO SUCCESS..

'strSQL = "Wer Like ""*strWer*"""
'strSQL = "Wer Like ""*cmbWer.Column(0)*"""
'strSQL = "Wer Like *cmbWer.Column(0)*"
'strSQL = "Wer Like *strWer*"

strSQL = "Wer Like *Forms!frmFilters!ctlName.Column(0)*"
DoCmd.OpenForm "frmMain", acNormal, , strSQL

But none of my strSQL works...
Any ideas??
thx,
gr
 
thx I already find the solution:
strSQL = "Wer Like ""*"" & Forms!frmFilters!ctlName
& ""*"""
 
Back
Top