Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00055504
Message ID:
00055516
Views:
29
>>>>>Hello,
>>>>>
>>>>>I have a UDF called ConvToView that takes a value and converts it to a normal looking time. For Example, I store 5:00p in a table as 1700.
>>>>>
>>>>>My problem is I want a grid that has a column bound to this particular field but I need to run this UDF on it first. In other words I want 5:00p to show in the text box rather than 1700.
>>>>>
>>>>>I have tried to put in the ControlSource of the column ConvToView(ava_bgntime) but this doesn't work. I also tried to put the function call in the InterActiveChangeEvent of the text box in the column but this didn't work either. Any Ideas?
>>>>>
>>>>>Paul
>>>>
>>>>If you will set ColumnX.ControlSource to Thisform.ConvToView(table.time) in Form Designer, then it should work Ok, assuming that ConvToView is form method.
>>>
>>>ConvToView is a function in a separate prg file. The main reason for this is that I use this function in many forms.
>>
>>I think that it will work too, assuming that you Set Procedure to the prg file.
>
>I have set procedure to the prg file. Whats odd is that if I just leave the control source to the table fields the grid shows the records(except that the time field is just a number) but as soon as I put ConvToView(ava_bgntime) in the controls source of the second column then no records appear in the grid plus I do not get an error message.
>
>Weird, huh?

Yes, it's weird. Is ava_bgntime field name? Did you try to add alias? Is it possible that you switched aliases in prg. I guess you should:
1. Test it with Form' method.
2. Test it adding new column on right.
I believe you will get right behaviour moving this way. The ultimate way to avoid controlsource problems is to set them for each column programmatically.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform