|
-
Mar 17th, 2010, 11:38 AM
#1
Thread Starter
Junior Member
-
Mar 17th, 2010, 11:40 AM
#2
Re: any help really appreciated
-
Mar 17th, 2010, 11:41 AM
#3
Re: any help really appreciated
If you have more then 1 condition in a WHERE clause they need to have an AND between each one. The word WHERE can only appear once...
Also should not be in VB.Net but in Database forum.
Matt beat me to the move....
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Mar 17th, 2010, 11:46 AM
#4
Thread Starter
Junior Member
Re: any help really appreciated
i dont understand how that will work though as doesn't each text box need to look at the individual column in the table? could you show me what to remove? cheers for helping i'm new to the game and am finding it pretty difficult
-
Mar 17th, 2010, 11:51 AM
#5
Thread Starter
Junior Member
Re: any help really appreciated
I'm sorry could you give me a little example of what you mean, I'm really new to this and thought that if i deleted each where then it wouldnt look up the text box in the individual table field? probably not!! thanks so much
-
Mar 17th, 2010, 11:54 AM
#6
Re: any help really appreciated
Like this
Code:
Dim strWhere As String
Dim lngLen As Long
If Not IsNull(Me.txtSurname) Then
strWhere = strWhere & "([PtSurname] Like ""*" & Me.txtSurname & "*"")"
End If
If Not IsNull(Me.txtFilterSite) Then
If Len(strWhere) > 0 Then
strWhere = strWhere & " AND "
End If
strWhere = strWhere & "([Site] Like ""*" & Me.txtFilterSite & "*"")"
End If
If Not IsNull(Me.TextUserName) Then
If Len(strWhere) > 0 Then
strWhere = strWhere & " AND "
End If
strWhere = strWhere & "([User] Like ""*" & Me.TextUserName & "*"")"
End If
If Not IsNull(Me.Textdate) Then
If Len(strWhere) > 0 Then
strWhere = strWhere & " AND "
End If
strWhere = strWhere & "([TransferDate] Like ""*" & Me.Textdate & "*"")"
End If
Me.Filter = strWhere
Me.FilterOn = True
End Sub
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Mar 17th, 2010, 11:56 AM
#7
Thread Starter
Junior Member
Re: any help really appreciated
u sir are my new hero! Legendary help mate you've saved my bacon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|