Please help with accent marks

A

Al

I am trying to allow my user to search in a form whether there are regular
letters or letters with accent marks like: E, È, É, Ê, or Ë. Can someone
help. I am using the following code:

==============================
Private Sub AddToWhere(FieldValue As Variant, FieldName As String,
MyCriteria As String, ArgCount As Integer)

' Create criteria for WHERE clause.
If FieldValue <> "" Then
' Add "and" if other criterion exists.
If ArgCount > 0 Then
MyCriteria = MyCriteria & " and "

End If

' Append criterion to existing criteria.
' Enclose FieldValue and asterisk in quotation marks.
MyCriteria = (MyCriteria & FieldName & " Like " & Chr(39) &
FieldValue & Chr(42) & Chr(39))

' Increase argument count.
ArgCount = ArgCount + 1
End If
End Sub
==============================
Private Sub Command3_Click()
' Create a WHERE clause using search criteria entered by user and
' set RecordSource property of Find Patient Subform.

Dim MySQL As String, MyCriteria As String, MyRecordSource As String
Dim ArgCount As Integer
Dim Tmp As Variant

' Initialize argument count.
ArgCount = 0

' Initialize SELECT statement.
MySQL = "SELECT * FROM qryCBCSearch WHERE "
MyCriteria = ""


' Use values entered in text boxes in form header to create criteria
for WHERE clause.
'AddToWhere "*" & [LookForSpanTranID], "[SpantranID]", MyCriteria,
ArgCount
AddToWhere "*" & [LookForCountryName], "[CountryName]", MyCriteria,
ArgCount
AddToWhere "*" & [LookForState], "[State]", MyCriteria, ArgCount
AddToWhere "*" & [LookForInstName], "[InstName]", MyCriteria, ArgCount
AddToWhere "*" & [LookForDocumentations], "[Documentations]",
MyCriteria, ArgCount
AddToWhere "*" & [LookForSubject], "[Subject]", MyCriteria, ArgCount
'AddToWhere "*" & [LookForDescription], "[Description]", MyCriteria,
ArgCount

'If no criterion specifed, return all records.
If MyCriteria = "" Then
MyCriteria = "True"
End If

' Create SELECT statement.
MyRecordSource = MySQL & MyCriteria '& " ORDER BY SpanTranID ASC"

' Set RecordSource property of Find Patient Subform.
Me.frmCBCSearchSub.Form.RecordSource = MyRecordSource
'DoCmd.OpenReport stDocName, acPreview

' If no records match criteria, display message.
' Move focus to Clear button.
If Me![frmCBCSearchSub].Form.RecordsetClone.RecordCount = 0 Then
msgbox "No records match the criteria you entered.", 48, "No Records
Found"
Me!Clear.SetFocus
Else
' Enable control in detail section.
Tmp = EnableControls("Detail", True)
' Move insertion point to Find CBC Subform.
Me![frmCBCSearchSub].SetFocus
End If
End Sub
=========================================
However, this code does not see the accent. is there a way to add this
capability to it or to use a new code that can see the accent. please help.
thanks
Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top