Hi, Noman (?)
A few thoughts: I assume you are using VFP? You can use EVAL and SEEK() and SELECT (cAlias) now to lessen the need for using macro expansion.
So instead of
>SELECT &cChildTable
you can
SELECT (cChildTable)
If you're getting an error on that line, it might because cChildTable isn't what you expect it to be.
But, what's even cooler is you can do a seek in a work area other than the selected one. So, you could get rid of it all together. Look up SEEK() in the help. The only sneaky thing about it is that you have to put an "=" before it, or just assign it to a variable. I.E.:
lOK = SEEK( eexpression, cChildTable, cIndexTag )
You might also be able to change
>DO WHILE &cChildTable.&cChildField1 = &cParentTable.&cParentField1
to
DO WHILE EVAL(cChildTable+'.'+cChildField1) = EVAL( cParentTable+'.'+cParentField1)
or, even to
SELECT (cChildTable)
LOCAL lcParentKey
lcParentKey = EVAL( cParentTable+'.'+cParentField1)
SCAN FOR mychildtable.fk = lcParentKey
HTH
>I have put in local parameters in INIT, have already defined property for the container to put table and field names and in REFRESH
>
>(cParent....., cChild....., cDesc.. are added properties)
>
>cOriginalTable = THIS.cParentTable
>
>*selects a table
>SELECT &cChildTable
>
>*Looks for wcnumber from wcdet in wcad
>SEEK &cParentTable.&cParentField1
>
>*removes any items in the list
>DO WHILE THIS.cbInfo.LISTCOUNT > 0
> THIS.cbInfo.REMOVEITEM(1)
>ENDDO
>
>*clears the list box
>THIS.cbInfo.Clear
>
>lShowVal = .T.
>
>*fills the list box
>IF FOUND()
>
> DO WHILE &cChildTable.&cChildField1 = &cParentTable.&cParentField1 ....... Continuee
>
>My question is that how will I be able to use the properties in thsi code to work properly as I am getting error .. well the error which I am getting is Unrecgonized error for the line
>
>SELECT &cChildTable
>
>PLEASE help me out THANX!