תחומים
    • הרשמה
    • התחברות
    • חיפוש
    • קטגוריות
    • פוסטים אחרונים
    • משתמשים
    • חיפוש
    חוקי הפורום

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

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

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

      ניתן ליצור עימי קשר במייל 8140hp+t@gmail.com | קנה לי פיצה!

      OdedDvir תגובה 1 תגובה אחרונה תגובה ציטוט 1
      • OdedDvir
        OdedDvir @אביי נערך לאחרונה על ידי

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

        אביי תגובה 1 תגובה אחרונה תגובה ציטוט 0
        • אביי
          אביי @OdedDvir נערך לאחרונה על ידי

          @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 | קנה לי פיצה!

          OdedDvir תגובה 1 תגובה אחרונה תגובה ציטוט 0
          • OdedDvir
            OdedDvir @אביי נערך לאחרונה על ידי

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

            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
            • 1 / 1
            • פוסט ראשון
              פוסט אחרון
            בא תתחבר לדף היומי!