General information
Category:
Coding, syntax & commands
I have to take a break from working and thank you all!
Everyone who is new to Fox (or migrating from FPW to VFP6 like
me), save this email/print it somewhere. You will need to
do some (slow) substring searches because a client has to have
it their way, and you might have to do it with a parameterized
view to boot. Code below has tabs and removed:
Here's my create view code:
Create SQL View Values_OrdProc2_TxtSearchGrid ;
Connection OrdProc4 ;
share ;
as ;
select ;
cItem_No , ;
cTitle , ;
cAuthor , ;
cMedia , ;
cPublish , ;
nWeight ;
from ;
Catlog ;
where ;
upper(cTitle) like (?cUsrFirstChoice) ;
upper(cAuthor) like (?cUsrSecondChoice) ;
upper(cPublish) like (?cUsrThirdChoice) ;
order by ;
cTitle, cAuthor , cPublish
In my form, here's the code behind the click event of my
'Text Search' button:
..yes, I think the code could be tighter...
cUsrFirstChoice =
upper(alltrim(ThisForm.PageFrame1.Page2.txtcSearchTitle.Value))
if empty(cUsrFirstChoice)
cUsrFirstChoice = '%'
else
cUsrFirstChoice = '%' + cUsrFirstChoice + '%'
endif
cUsrSecondChoice =
upper(alltrim(ThisForm.PageFrame1.Page2.txtcSearchAuthor.Value))
if empty (cUsrSecondChoice)
cUsrSecondChoice = '%'
else
cUsrSecondChoice = '%' + cUsrSecondChoice + '%'
endif
cUsrThirdChoice =
upper(alltrim(ThisForm.PageFrame1.Page2.txtcSearchPub.Value))
if empty(cUsrThirdChoice)
cUsrThirdChoice = '%'
else
cUsrThirdChoice = '%' + cUsrThirdChoice + '%'
endif
Requery('values_OrdProc2_TxtSearchGrid')
ThisForm.PageFrame1.Page2.Grid1.RecordSource =
'values_OrdProc2_TxtSearchGrid'
ThisForm.PageFrame1.Page2.Grid1.Refresh
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only