Related Record Count Syntax Please
    Chuck Pelto 
    cbpelto at pcisys.net
       
    Tue Dec 21 10:40:55 CST 2004
    
    
  
Morning Ruslan,
On Dec 18, 2004, at 3:10 PM, Ruslan Zasukhin wrote:
>> [1] It sounds like I have to delve into SQL, for the time being, to 
>> get
>> the count of related records.
>
> Just you can do this in a little simple way.
> Let you have some record in T1. You know its RecID.
>
> So you can do SQL quyry
>
>   curs = SELECT RecID FRON T2 WHERE Ptr = recid
>   res = curs.RecordCont
>
Pursuing this activity I added three lines of code to Window 1's 
PopulatePanes() method.
dim tCursor as integer
currRecID = mDataBase.mPerson.GetRecID() // get record ID for the 
current parent record
tCursor = SELECT * FROM Person, Task WHERE mPersonPtr = currRecID // 
mPersonPtr is the field in the boTask that holds the pointer to the 
related parent record in boPerson.
I'm getting a syntax error on the last line.
* Syntax error in Window1.PopulatePanes, line 24:
tCursor = SELECT * FROM Person, Task WHERE mPersonPtr = currRecID
So what is wrong with this?
Thanks,
Chuck
    
    
More information about the Valentina
mailing list