SyafiqIzzat
Registered User.
- Local time
- Today, 15:05
- Joined
- Aug 16, 2010
- Messages
- 19
Hello all, I'm working with filtering data and I had just found this code, very helpful indeed but I just need help to understand it in depth.
Dim strSQL As String
strSQL = "1 = 1"
If Len(Nz(Me.Combo104, "")) > 0 Then
strSQL = strSQL & " and [Part Type] = """ & Me.Combo104 & """"
End If
If Len(Nz(Me.Combo110, "")) > 0 Then
strSQL = strSQL & " and [Identifier] = """ & Me.Combo110 & """"
End If
If Len(Nz(Me.Combo113, "")) > 0 Then
strSQL = strSQL & " and [Shaft] = """ & Me.Combo113 & """"
End If
Me.Filter = strSQL
Me.FilterOn = True
I don't understand what does strSQL ="1 = 1" means? and what actually the rest of the codes do from strSQL="1 = 1".
Thank You in advance
Dim strSQL As String
strSQL = "1 = 1"
If Len(Nz(Me.Combo104, "")) > 0 Then
strSQL = strSQL & " and [Part Type] = """ & Me.Combo104 & """"
End If
If Len(Nz(Me.Combo110, "")) > 0 Then
strSQL = strSQL & " and [Identifier] = """ & Me.Combo110 & """"
End If
If Len(Nz(Me.Combo113, "")) > 0 Then
strSQL = strSQL & " and [Shaft] = """ & Me.Combo113 & """"
End If
Me.Filter = strSQL
Me.FilterOn = True
I don't understand what does strSQL ="1 = 1" means? and what actually the rest of the codes do from strSQL="1 = 1".
Thank You in advance