View Single Post
  #1  
Old June 16th, 2005, 03:55 PM
Kevin Beck via AccessMonster.com
external usenet poster
 
Posts: n/a
Default "data type mismatch" trying to execute dialogue form

Hey,

I have a report with a form that I am trying to use to filter and then to
sort results.

You choose a "section #" in a combobox named cboSection between 1 and 30 and
then sort the report up to three levels. When I try to apply the filter I get
msg "Data Type Mismatch in Criteria Expression" Does anyone know how to
remedy this? The following code is from the "on click" event of the "filter"
command button.

Private Sub cmdApplyFilter_Click()
Dim strSection As String
Dim strFilter As String
If IsNull(Me.cboSection.Value) Then
strSection = "Like '*'"
Else
strSection = "='" & strSection & "'"
End If

strFilter = "[Section] " & strSection

With Reports![rptCompGranteeLot]
.Filter = strFilter
.FilterOn = True
End With
End Sub

Many thanks for anyone who might be able to help

Kawg

--
Message posted via http://www.accessmonster.com