N
\NG Tian via AccessMonster.com\
hi ppl
I had a minor problem how to deal the wildcard function as "like"
My requirement is when i input any ABC in textbox{txtSearch}, then i press a
button to return all the records with first A. for etc, i input Ba in textbox
and press button to return all the records with first Ba, etc Barcon, Bail,
Bapalia, and go on.
my current simple code does not work, because when i input A, it return one
result although i have thousand of words starting with A.
Are u able to help ?
The code is like that,
Option Compare Database
Option Explicit
Private Sub cmdSearch_Click()
On Error GoTo Err_cmdSearch_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Search Engine"
stLinkCriteria = "[Project] like " & Chr$(34) & Me![txtSearch] & "*" &
Chr$(34)
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdSearch_Click:
Exit Sub
Err_cmdSearch_Click:
MsgBox Err.Description
Resume Exit_cmdSearch_Click
End Sub
I had a minor problem how to deal the wildcard function as "like"
My requirement is when i input any ABC in textbox{txtSearch}, then i press a
button to return all the records with first A. for etc, i input Ba in textbox
and press button to return all the records with first Ba, etc Barcon, Bail,
Bapalia, and go on.
my current simple code does not work, because when i input A, it return one
result although i have thousand of words starting with A.
Are u able to help ?
The code is like that,
Option Compare Database
Option Explicit
Private Sub cmdSearch_Click()
On Error GoTo Err_cmdSearch_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Search Engine"
stLinkCriteria = "[Project] like " & Chr$(34) & Me![txtSearch] & "*" &
Chr$(34)
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdSearch_Click:
Exit Sub
Err_cmdSearch_Click:
MsgBox Err.Description
Resume Exit_cmdSearch_Click
End Sub