W
Warren
I entered this code as directed and now I get the
following message:
RunTime Error '3075'
"Extra ) in Query Expression"
I CAN'T FIND IT IF IT IS THERE
CAN ANYONE HELP ME?
Private Sub cmdPreview_Click()
Dim strWhere As String
Dim lngLen As Long
'stDocName = "Recording Search Report2"
'DoCmd.OpenReport stDocName, acPreview
If Not IsNull(cboRecordingArtistName) Then
strWhere = strWhere & "([RecordingArtistName])
= """ & _
cboRecordingArtistName & """) AND "
End If
If Not IsNull(cboRecordingTitle) Then
strWhere = strWhere & "([RecordingTitle]) = """ & _
cboRecordingTitle & """) AND "
End If
If Not IsNull(cboTrackTitle) Then
strWhere = strWhere & "([TrackTitle]) = """ & _
cboTrackTitle & """) AND "
End If
If Not IsNull(cboTrackNumber) Then
strWhere = strWhere & "([TrackNumber]) = """ & _
cboTrackNumber & """) AND "
End If
If Not IsNull(cboTrackLength) Then
strWhere = strWhere & "([TrackLength]) = """ & _
cboTrackLength & """) AND "
End If
If Not IsNull(cboTrackTempo) Then
strWhere = strWhere & "([TrackTempo]) = """ & _
cboTrackTempo & """) AND "
End If
If Not IsNull(cboMusicCategory) Then
strWhere = strWhere & "([MusicCategory]) = """ & _
cboMusicCategory & """) AND "
End If
If Not IsNull(cboTrackSpecialty) Then
strWhere = strWhere & "([TrackSpecialty]) = """ & _
cboTrackSpecialty & """) "
End If
lngLen = Len(strWhere) - 8
If lngLen > 0 Then
strWhere = Left$(strWhere, lngLen)
End If
'open Report
DoCmd.OpenReport "Recording Search Report",
acViewPreview, , strWhere
End Sub
following message:
RunTime Error '3075'
"Extra ) in Query Expression"
I CAN'T FIND IT IF IT IS THERE
CAN ANYONE HELP ME?
Private Sub cmdPreview_Click()
Dim strWhere As String
Dim lngLen As Long
'stDocName = "Recording Search Report2"
'DoCmd.OpenReport stDocName, acPreview
If Not IsNull(cboRecordingArtistName) Then
strWhere = strWhere & "([RecordingArtistName])
= """ & _
cboRecordingArtistName & """) AND "
End If
If Not IsNull(cboRecordingTitle) Then
strWhere = strWhere & "([RecordingTitle]) = """ & _
cboRecordingTitle & """) AND "
End If
If Not IsNull(cboTrackTitle) Then
strWhere = strWhere & "([TrackTitle]) = """ & _
cboTrackTitle & """) AND "
End If
If Not IsNull(cboTrackNumber) Then
strWhere = strWhere & "([TrackNumber]) = """ & _
cboTrackNumber & """) AND "
End If
If Not IsNull(cboTrackLength) Then
strWhere = strWhere & "([TrackLength]) = """ & _
cboTrackLength & """) AND "
End If
If Not IsNull(cboTrackTempo) Then
strWhere = strWhere & "([TrackTempo]) = """ & _
cboTrackTempo & """) AND "
End If
If Not IsNull(cboMusicCategory) Then
strWhere = strWhere & "([MusicCategory]) = """ & _
cboMusicCategory & """) AND "
End If
If Not IsNull(cboTrackSpecialty) Then
strWhere = strWhere & "([TrackSpecialty]) = """ & _
cboTrackSpecialty & """) "
End If
lngLen = Len(strWhere) - 8
If lngLen > 0 Then
strWhere = Left$(strWhere, lngLen)
End If
'open Report
DoCmd.OpenReport "Recording Search Report",
acViewPreview, , strWhere
End Sub