PDA

View Full Version : خطای 3075



shafiey2005
یک شنبه 15 مهر 1397, 08:33 صبح
با سلام و تشکر از سایت برنامه نویس. لطفا راهنمایی فرمایید.

بنده در حال آموزش اکسس هستم و از مطالب ارزنده ی شما کمال استفاده را برده ام.
هنگام اجرای جستجو در فرم، خطای 3075 را مشاهده میکنم و سطر Me.Filter = strWhere
زرد رنگ می گردد.
آلگوریتم کامل پنجره به صورت زیر است لطفا خطای موجود را برایم اصلاح فرمایید با سپاس فراوان.
Private Sub cmdFilter_Click()
Dim strWhere As String
Dim lngLen As Long
Const conJetDate = "\#mm\/dd\/yyyy\#"

If Not IsNull(Me.Text01) Then
strWhere = strWhere & "([ID] Like ""*" & Me.Text01 & "*"") AND "
End If

If Not IsNull(Me.Text02) Then
strWhere = strWhere & "([Tarh_Project] Like ""*" & Me.Text02 & "*"") AND "

End If
If Not IsNull(Me.Text03) Then
strWhere = strWhere & "([Title] Like ""*" & Me.Text03 & "*"") AND "
End If

If Not IsNull(Me.Text04) Then
strWhere = strWhere & "([Mojri] Like ""*" & Me.Text04 & "*"") AND "
End If

If Not IsNull(Me.Text05) Then
strWhere = strWhere & "([Bakhsh] Like ""*" & Me.Text05 & "*"") AND "
End If

If Not IsNull(Me.Text06) Then
strWhere = strWhere & "([Karfarma] Like ""*" & Me.Text06 & "*"") AND "
End If

If Not IsNull(Me.Text07) Then
strWhere = strWhere & "([Karshenas_Nazer] Like ""*" & Me.Text07 & "*"") AND "
End If

If Not IsNull(Me.Text08) Then
strWhere = strWhere & "([Tarikh_Shorou] >= " & Me.Text08 & ") AND "
End If

If Not IsNull(Me.Text09) Then
strWhere = strWhere & "([Tarikh_Shorou] <= " & Me.Text09 & ") AND "
End If

If Not IsNull(Me.Text10) Then
strWhere = strWhere & "([Tarikh_Khatameh] >= " & Me.Text10 & ") AND "
End If

If Not IsNull(Me.Text11) Then
strWhere = strWhere & "([Tarikh_Khatameh] <= " & Me.Text11 & ") AND "
End If

If Not IsNull(Me.Text12) Then
strWhere = strWhere & "([Shomareh_Mosavab] Like ""*" & Me.Text12 & "*"") AND "
End If

If Not IsNull(Me.Text13) Then
strWhere = strWhere & "([Shomareh_Farvast] Like ""*" & Me.Text13 & "*"") AND "
End If

If Not IsNull(Me.Text14) Then
strWhere = strWhere & "([Tarikh_Eblagh] >= " & Me.Text14 & ") AND "
End If

If Not IsNull(Me.Text15) Then
strWhere = strWhere & "([Tarikh_Eblagh] <= " & Me.Text15 & ") AND "
End If

If Not IsNull(Me.Text16) Then
strWhere = strWhere & "([Shomareh_Nameh] Like ""*" & Me.Text16 & "*"") AND "
End If

If Not IsNull(Me.Text17) Then
strWhere = strWhere & "([Shomareh_Sanad] Like ""*" & Me.Text17 & "*"") AND "
End If

If Not IsNull(Me.Text18) Then
strWhere = strWhere & "([Mahale_Erjae] Like ""*" & Me.Text18 & "*"") AND "
End If

If Not IsNull(Me.Text19) Then
strWhere = strWhere & "([Code_Rahgiri] Like ""*" & Me.Text19 & "*"") AND "
End If

If Not IsNull(Me.Text20) Then
strWhere = strWhere & "([Mablagh_Gharardad] >= " & Me.Text20 & ") AND "
End If

If Not IsNull(Me.Text21) Then
strWhere = strWhere & "([Mablagh_Gharardad] <= " & Me.Text21 & ") AND "
End If

If Not IsNull(Me.Text22) Then
strWhere = strWhere & "([SumOfMablagh_Varizi] >= " & Me.Text22 & ") AND "
End If

If Not IsNull(Me.Text23) Then
strWhere = strWhere & "([SumOfMablagh_Varizi] <= " & Me.Text23 & ") AND "
End If

If Not IsNull(Me.Text24) Then
strWhere = strWhere & "([Mandeh] >= " & Me.Text24 & ") AND "
End If

If Not IsNull(Me.Text25) Then
strWhere = strWhere & "([Mandeh] <= " & Me.Text25 & ") AND "
End If


lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "No criteria", vbInformation, "Nothing to do."
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
End Sub

Private Sub cmdReset_Click()
Dim ctl As Control
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType
Case acTextBox
If ctl.Name <> "Text26" Then
ctl.Value = ""
End If

Case acCheckBox
ctl.Value = False
End Select
Next

Me.FilterOn = False
End Sub

Private Sub Command16_Click()
DoCmd.OpenForm "frm_Database_ForSearch", , , "ID = " & Me!ID
End Sub

Private Sub Form_BeforeInsert(Cancel As Integer)
Cancel = True
MsgBox "You cannot add new clients to the search form.", vbInformation, "Permission denied."
End Sub

shafiey2005
یک شنبه 15 مهر 1397, 08:53 صبح
لطفا یکی از اساتید جواب بدن لطفا

Ali_Fallah
یک شنبه 15 مهر 1397, 20:42 عصر
برنامه رو ضمیمه کن ...