The names in VFP cannot start with digits. It has to start with a letter or "_" (underscore). Someting like
lcPillName = "P" + TRANSFORM(pills.id)
>
>Basically, I want to store pills.ID field in a variable (lcPillName).
>What's wrong in this code?
>
>Why AddObject(lcPillName...) returns a syntax error? I want to add a 'pill' object named, let's say '1' or '2'...
>
>
>lcPillName=''
>
>SCAN
>
> lcPillName = str(pills.id)
> Thisform.AddObject(lcPillName,'pill')
>
>
--sb--