Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Access, Me.filter

  1. #1

    Access, Me.filter

    Ciao,

    voglio creare una maschera access con delle caselle combinate da usare come filtro su alcuni campi.

    Ho usato questo codice e funziona:
    ________________

    Private Sub casellacombinata66_Change()
    On Error GoTo Gesterror

    If [CasellaCombinata66] <> "All" Then
    Me.Filter = "[Legal form]=" & "'" & Me![CasellaCombinata66] & "'"
    Me.FilterOn = True
    Else
    Me.FilterOn = False
    End If

    Exit Sub

    Gesterror:
    Resume Next

    End Sub
    __________________

    Il problema è che non riesco a lanciare un filtro su 2 campi cioè non riesco a dirgli di darmi tutti i record con [Legal Form] xxx & [Activity] yyyy.

    Come fare?

    Grazie

  2. #2
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Me.Filter = "[Legal form]=" & "'" & Me![CasellaCombinata66] & "' and [Activity] = '" & Me![NomeDelControllo] & "'"
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  3. #3
    L'avevo già provata ma evidentemente sbagliando qualcosa nella sintassi.

    Funzia...Mercì

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.