דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
  1. דף הבית
  2. תוכנה
  3. אקסס | חיפוש בטופס

אקסס | חיפוש בטופס

מתוזמן נעוץ נעול הועבר תוכנה
4 פוסטים 2 כותבים 169 צפיות
  • מהישן לחדש
  • מהחדש לישן
  • הכי הרבה הצבעות
התחברו כדי לפרסם תגובה
נושא זה נמחק. רק משתמשים עם הרשאות מתאימות יוכלו לצפות בו.
  • אבייא מנותק
    אבייא מנותק
    אביי
    כתב ב נערך לאחרונה על ידי
    #1

    יש לי טופס אקסס שיש בו תיבת טקסט להזנת ערך לחיפוש, איך אני עושה שבלחיצה אנטר, מלבד מה שזה עובר לתיבה הבאה, זה גם יחפש? זאת אומרת ילחץ על כפתור הסינון?
    ניסיתי באמצעות האירועים ביציאה ולאחר עדכון אבל הם לא עושים את העבודה.

    ניתן ליצור עימי קשר 8140hp+t@gmail.com | קטלוג מוצרים
    הלינקיה שלי https://abaye.co/link.html

    OdedDvirO תגובה 1 תגובה אחרונה
    1
    • OdedDvirO מנותק
      OdedDvirO מנותק
      OdedDvir
      השיב לאביי ב נערך לאחרונה על ידי
      #2

      @אביי הארוע לאחר עדכון אמור לטפל בנושא. ייתכן שמשהו בקוד לא נכון. אם תפרט את הקוד אנסה לעזור

      אבייא תגובה 1 תגובה אחרונה
      0
      • אבייא מנותק
        אבייא מנותק
        אביי
        השיב לOdedDvir ב נערך לאחרונה על ידי
        #3

        @OdedDvir הכפתור חיפוש הוא "cmdFilter" איך אני עושה בקוד לאחר עידכון שכביכול יילחץ עליו?

        בינתיים מה שניסיתי לעשות זה לשים את הקוד של בעת לחיצה של הלחצן בלאחר עידכון, הוא עושה את העבודה אך בד בבד, הוא נשאר בשדה הראשון, וכדי להקליד בשדה השני, אני צריך ללחוץ פעמיים אנטר, וזה לא נח, מה גם שלא נשמע לי לשים כל פעם את כל הקוד...

        Private Sub Filter1_AfterUpdate()
            'Purpose:   Build up the criteria string form the non-blank search boxes, and apply to the form's Filter.
            'Notes:     1. We tack " AND " on the end of each condition so you can easily add more search boxes; _
                                we remove the trailing " AND " at the end.
            '           2. The date range works like this: _
                                Both dates      = only dates between (both inclusive. _
                                Start date only = all dates from this one onwards; _
                                End date only   = all dates up to (and including this one).
            Dim strWhere As String                  'The criteria string.
            Dim lngLen As Long                      'Length of the criteria string to append to.
            Const conJetDate = "\#mm\/dd\/yyyy\#"   'The format expected for dates in a JET query string.
            
            '***********************************************************************
            'Look at each search box, and build up the criteria string from the non-blank ones.
            '***********************************************************************
            'Text field example. Use quotes around the value in the string.
            If Not IsNull(Me.Filter1) Then
                strWhere = strWhere & "([עיר] Like ""*" & Me.Filter1 & "*"") AND "
            End If
            
            'Another text field example. Use Like to find anywhere in the field.
            If Not IsNull(Me.FilterCity) Then
                strWhere = strWhere & "([משפחה] Like ""*" & Me.FilterCity & "*"") AND "
            End If
            
            If Not IsNull(Me.Filter2) Then
                strWhere = strWhere & "([אזור] Like ""*" & Me.Filter2 & "*"") AND "
            End If
            
            '***********************************************************************
            'Chop off the trailing " AND ", and use the string as the form's Filter.
            '***********************************************************************
            'See if the string has more than 5 characters (a trailng " AND ") to remove.
            lngLen = Len(strWhere) - 5
            If lngLen <= 0 Then     'Nah: there was nothing in the string.
                MsgBox "היי, אנחנו לא יכולים לחפש אם לא אמרת לנו מה לחפש :)", vbInformation, "שגיאה"
            Else                    'Yep: there is something there, so remove the " AND " at the end.
                strWhere = Left$(strWhere, lngLen)
                'For debugging, remove the leading quote on the next line. Prints to Immediate Window (Ctrl+G).
                'Debug.Print strWhere
                
                'Finally, apply the string as the form's Filter.
                Me.Filter = strWhere
                Me.FilterOn = True
              End If
        End Sub
        

        ניתן ליצור עימי קשר 8140hp+t@gmail.com | קטלוג מוצרים
        הלינקיה שלי https://abaye.co/link.html

        OdedDvirO תגובה 1 תגובה אחרונה
        0
        • OdedDvirO מנותק
          OdedDvirO מנותק
          OdedDvir
          השיב לאביי ב נערך לאחרונה על ידי
          #4

          @אביי אמר באקסס | חיפוש בטופס:
          קודם כל, תעביר את הקוד לפרוצדורה נפרדת:

          Private Sub ApplyFilter()
              
                  'Purpose:   Build up the criteria string form the non-blank search boxes, and apply to the form's Filter.
                  'Notes:     1. We tack " AND " on the end of each condition so you can easily add more search boxes; _
                                         we remove the trailing " AND " at the end.
              
          '        ..... כל שאר הקוד
              End Sub
          

          ותקרא לה מתוך הארוע של תיבת הטקסט

          Private Sub Filter1_AfterUpdate()
              ApplyFilter
          End Sub
          

          ותקרא לה גם מתוך הלחצן:

          Private Sub cmdFilter_Click()
              ApplyFilter
          EndSub
          

          כך נכון לעשות מכל הבחינות

          שנית, אתה יכול להכריח לעבור לפקד הבא לאחר העדכון של תיבת הטקסט, על ידי שימוש בSetFocus(), למשל אם אתה רוצה לעבור אחרי לחיצת אנטר לפקד txtSomeControl:

          Private Sub Filter1_AfterUpdate()
              ApplyFilter
              Me.txtSomeControl.SetFocus
          End Sub
          
          תגובה 1 תגובה אחרונה
          0

          בא תתחבר לדף היומי!
          • התחברות

          • אין לך חשבון עדיין? הרשמה

          • התחברו או הירשמו כדי לחפש.
          • פוסט ראשון
            פוסט אחרון
          0
          • דף הבית
          • קטגוריות
          • פוסטים אחרונים
          • משתמשים
          • חיפוש
          • חוקי הפורום