0
Ich muss die Vorgänge in einem Konto zu einem bestimmten Zeitpunkt überprüfen, indem ich den Benutzer zur Eingabe der Kontonummer und des Datumsbereichs auffordere. Ich erhalte jedoch jedes Mal den Fehler "type mismatch "Anzeigen von Kontovorgängen nach Datum
Hier ist der Code:
Private Sub cmdSearch_Click()
Call search
End Sub
Sub search()
Dim strCriteria, strCount, task As String
Me.Refresh
If IsNull(Me.compte_hist) Or IsNull(Me.date_deb) Or IsNull(Me.date_fin) Then
MsgBox "s'il vous plaît assurez-vous que tous les champs sont remplis", vbInformation, "Date Range Required"
Me.compte_hist.SetFocus
Else
strCriteria = "([Date_operation]>= #" & Me.date_deb & "# And [Date_operation] <= #" & Me.date_fin & "#)"
strCount = "[Compte]=#" & Me.compte_hist & "#"
task = "select * from Operations where Operations (" & strCriteria & ")" And " (" & strCount & ") order by [Date_operation]"
DoCmd.ApplyFilter task
End If
End Sub
Freundliche Anmerkung, 'strCriteria' und' strCount' sind Varianten. siehe [doc] (http://stackoverflow.com/documentation/vba/877/declaring-variables/2957/dim#t=201607281239547850873) – litelite