Prev: Referencing Forms
Next: Keep getting error from code
From: Dirk Goldgar on 5 Apr 2010 10:15 "Dale" <Dale(a)discussions.microsoft.com> wrote in message news:CBD70BEE-B067-4CDD-B758-8FC5775F29A4(a)microsoft.com... > > The code does not find any of the phrases in the callphrases table even > though they exist. If I replace the strsql string with "[callphrase]='" & > """called client""", the code works. Its only when I'm referencing the > forms > control does it not work or so it appears. Changing the memo type to text > did > not make a difference. The memo field is set to plain text. So I'm at a > loss. Add a line Debug.Print strsql ..... just before the call to FindFirst, and report what that shows. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: David W. Fenton on 5 Apr 2010 20:23 =?Utf-8?B?RGFsZQ==?= <Dale(a)discussions.microsoft.com> wrote in news:9096FC44-27E4-4037-930C-479F84959951(a)microsoft.com: > Can anyone enlighten me on why this won't work? Why are you walking through the records to do this? Why not present a list of the records with the phrase and let the user click on each in turn to pull up each record? Or just filter the form to display only the matching records? I implement lots of functionality to allow users to find records, but have not once used walking a recordset as the way I implemented it. -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/
From: Dale on 5 Apr 2010 23:55 "David W. Fenton" wrote: > =?Utf-8?B?RGFsZQ==?= <Dale(a)discussions.microsoft.com> wrote in > news:9096FC44-27E4-4037-930C-479F84959951(a)microsoft.com: > > > Can anyone enlighten me on why this won't work? > > Why are you walking through the records to do this? Why not present > a list of the records with the phrase and let the user click on each > in turn to pull up each record? Or just filter the form to display > only the matching records? > > I implement lots of functionality to allow users to find records, > but have not once used walking a recordset as the way I implemented > it. > > -- > David W. Fenton http://www.dfenton.com/ > usenet at dfenton dot com http://www.dfenton.com/DFA/ > . I'm using the NoMatch = False to trigger a msgbox to the user having them confirm the action i.e. msgbox "pls confirm you have called the client." To Dirk's question, when I debug the sqlstr every once in a while I get this: [CallPhrase]='<div>called patient</div>' which explains why the strsql failed, seems when I edit the memo field I get the <div> tags even though field is set to plain text. This was only visible in the table and not the form (I was mostly troubleshooting from the form). So this code does work, but now my new problem, the code works only with exact matches, I was hoping findfirst would find partial matches i.e. the call phrase = called patient but if the from I'm searching against has "Once the investigation was completed the patient was called", the match fails. I'm thinking I need to find another way of doing this. Thanks all
From: Dirk Goldgar on 6 Apr 2010 01:15 "Dale" <Dale(a)discussions.microsoft.com> wrote in message news:1279F95A-0E09-4177-863E-4BD88F0215B6(a)microsoft.com... > > To Dirk's question, when I debug the sqlstr every once in a while I get > this: [CallPhrase]='<div>called patient</div>' which explains why the > strsql > failed, seems when I edit the memo field I get the <div> tags even though > field is set to plain text. This was only visible in the table and not > the > form (I was mostly troubleshooting from the form). So this code does work, > but now my new problem, the code works only with exact matches, I was > hoping > findfirst would find partial matches i.e. the call phrase = called patient > but if the from I'm searching against has "Once the investigation was > completed the patient was called", the match fails. > > I'm thinking I need to find another way of doing this. You can specify the Like operator in your FindFirst criteria string: strsql = "[CallPhrase] Like '*" & _ [Forms]![frmConcernlog]![tblevents subform].[Form]![eInvestigation] & _ "*'" (though you'd need to remove the <div> and </div> tags). However, that will still not find that second string you mentioned. So you do need to think about it a bit more. -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup)
From: David W. Fenton on 6 Apr 2010 21:34
"Dirk Goldgar" <dg(a)NOdataSPAMgnostics.com.invalid> wrote in news:443FED60-045F-4887-8827-4AD3B7FF1565(a)microsoft.com: > (though you'd need to remove the <div> and </div> tags). Isn't there a function in there to return HTML memo fields as plain text? -- David W. Fenton http://www.dfenton.com/ usenet at dfenton dot com http://www.dfenton.com/DFA/ |