Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Aldrin Austria
  Where is Aldrin Austria?
 Winnipeg
 Canada
 Aldrin Austria
 Tags
Subject: RE: Correct syntax in controlsource
Thread ID: 188943 Message ID: 188946 # Views: 1 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Tuesday, August 12, 2008 6:54:14 PM         
   


> This works fine in my code...
>
>
>
thisform.grid1.coluMN1.ControlSource = 	'ttod(curtest.mydt)'

>
> Now, if my source is stored in a property of a form and I define my control source like the one below...
>
thisform.mygridalias = 'curtest'
> myf1= thisform.mygridalias + [.mydt]
> thisform.grid1.column1.ControlSource = 	'ttod(myf1)'

>
> I got the eror "Function argument value, type, or count is invalid."
>
> So my question is how can I display a particular field (from the sample a Datetime to a Date) in a grid if my source is created like the 2nd example.
>
> TIA!
>
> Aldrin

myF1 is going out of scope when TTOD() is evaluated. That is why you get error message. Try this:
thisform.mygridalias = 'curtest'
myf1= thisform.mygridalias + [.mydt]
thisform.grid1.column1.ControlSource = 	[ttod(] + m.myf1 + [)]

-----------------
Borislav Borissov

Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.

ENTIRE THREAD

Correct syntax in controlsource Posted by Aldrin Austria @ 8/12/2008 6:48:45 PM
RE: Correct syntax in controlsource Posted by Cetin Basoz @ 8/12/2008 6:52:49 PM
RE: Correct syntax in controlsource Posted by Borislav Borissov @ 8/12/2008 6:54:14 PM
RE: Correct syntax in controlsource Posted by Aldrin Austria @ 8/12/2008 6:59:25 PM