>>I,ve made a search form for my little program but I.m having a bit of trouble getting the search form to search all the fields in a database, I can only get it to search one field. Can somebody help me?
>>
>>Thanks!
>>Bill Clark
>
>Check out 'AFields()' in the Help file. See if this will get you started.
>
>HTH,
>Tom
Hmmm...With AFileds() you can of course get all the fields and do
a Locate For a value on each of them. But I would do it diffently:
m_SearchValue = ThisForm.EntryField1.Value
m_Order = ""
m_Found = .F.
FOR i = 1 TO 254
IF !EMPTY(TAG(i))
m_Order = TAG(i)
SET ORDER TO TAG &m_Order
IF SEEK(m_SearchValue)
m_Found = .T.
EXIT
ENDIF
ELSE
EXIT
ENDIF
NEXT i
Just make sure you create a CDX with tags for all possible searchable
fields, otherwise your FOR loop will execute only once with no success.
Some things are better be left unknown...NOT!!!