rupes_mahal
Registered User.
- Local time
- Today, 17:40
- Joined
- Aug 12, 2001
- Messages
- 60
hi..
I have set up a search form. It is working fine. But I also have a problem with it.
I have a field called "Names" in the search form. At the moment, it is working fine, by looking at one column in the table and finding it. But i also have names in other columns. I want the search to be able to search from all the 4 columns from the table and then display the results.
The code for that part so far is:
If Not IsNothing(Me!names) Then
If IsNothing(gstrWhereCust) Then
gstrWhereCust = "[names1] Like " & Chr$(34) & Me!names
Else
gstrWhereCust = gstrWhereCust & " AND [names1] Like " & Chr$(34) & Me!names
End If
If Right$(Me!Names, 1) = "*" Then
gstrWhereCust = gstrWhereCust & Chr$(34)
Else
gstrWhereCust = gstrWhereCust & "*" & Chr$(34)
End If
End If
This works. As you can see it only looks at [names1] column and no other. How do i make it look at [names2], [names3], [names4], etc columns to do the search successfully. I need to add more code to it, but I dont know where and how to.
Please help..
Thank you in advance
ruby
I have set up a search form. It is working fine. But I also have a problem with it.
I have a field called "Names" in the search form. At the moment, it is working fine, by looking at one column in the table and finding it. But i also have names in other columns. I want the search to be able to search from all the 4 columns from the table and then display the results.
The code for that part so far is:
If Not IsNothing(Me!names) Then
If IsNothing(gstrWhereCust) Then
gstrWhereCust = "[names1] Like " & Chr$(34) & Me!names
Else
gstrWhereCust = gstrWhereCust & " AND [names1] Like " & Chr$(34) & Me!names
End If
If Right$(Me!Names, 1) = "*" Then
gstrWhereCust = gstrWhereCust & Chr$(34)
Else
gstrWhereCust = gstrWhereCust & "*" & Chr$(34)
End If
End If
This works. As you can see it only looks at [names1] column and no other. How do i make it look at [names2], [names3], [names4], etc columns to do the search successfully. I need to add more code to it, but I dont know where and how to.
Please help..
Thank you in advance
ruby