اذهب الي المحتوي
أوفيسنا

تعديل فى كود vba


jamal2080

الردود الموصى بها

 

السلام عليكم 

عندى فورم رئيسى اسمة frm_RD  عندى ضعط على البحث يظهر نمودج البحث فية عدد خيارات 

- رقم تقرير الاستلام

- رقم الطلبية

- رقم طلب التوريد 

اريد منكم لو تكرمتوا اجد خطاء فى الكود

Private Sub cmd_search_Click()
Dim str As String
Dim str_2 As String
Dim mth As Integer
Dim X
 
  If GENERAL.PRVCTRL.ControlType <> acComboBox Then
   
    
             If Me.FLDSRH <> "" Then
     
                                Select Case Me.srhtyp.Value
        
                                  Case "1"
                                            str = Me.FLDSRH & " = " & """" & Me.str & """"
                                            str_2 = Me.FLDSRH & " = " & Me.str
               
                                  Case "2"
                                            str = Me.FLDSRH & " LIKE " & """" & Me.str & "*"""
                                  Case "3"
                                            str = Me.FLDSRH & " LIKE " & """*" & Me.str & "*"""
                                  Case "4"
                                            str = Me.FLDSRH & " LIKE " & """*" & Me.str & """"
                                End Select
    
                 Else
                           str = "1=1"
             End If
    
    
  Else
    
                 X = GENERAL.PRVCTRL.RowSource

                 X = GENERAL.PRVCTRL.Column(1)

                If Me.FLDSRH <> "" Then
     
                           Select Case Me.srhtyp.Value
        
                                  Case "1"
                                         str = Me.FLDSRH & " = " & """" & Me.str & """"
                                         str_2 = Me.FLDSRH & " = " & Me.str
                                  Case "2"
                                         str = Me.FLDSRH & " LIKE " & """" & Me.str & "*"""
                                  Case "3"
                                         str = Me.FLDSRH & " LIKE " & """*" & Me.str & "*"""
                                  Case "4"
                                         str = Me.FLDSRH & " LIKE " & """*" & Me.str & """"
                           End Select
    
                  Else
                         str = "1=1"
                 End If


   End If

If IsNull(Me.srhtyp.Value) Then
  mth = 0
Else
  mth = Me.srhtyp.Value
End If
DO_FIND str, str_2, mth
Rem DoCmd.Close acForm, "frm_find", acSaveYes
End Sub

 

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information