Hello,
I found out how to use a form class and set the DE as per my previous message.
The controls are not accepting input when I try to append a record to the table.
The field values are displayed as normal for existing records. Is there a property I'm missing?
Eric K.
>Hi Eric,
>How does setting controlsource fail ? Normally when you drop a form class, form is automatically contained in a formset, might it be you're referencing from a prg and you should also include "thisformset." or formsetname ?
>Cetin
>
>>Sawadee Kahp,
>>
>>I am also having problems setting a controlsource property on a .scx that was created using a form class. The last suggestions from Cetin seems to work only for .scx built in the form designer from scratch. I built a form from scratch in the form designer that looks exactly like the form derived from a classlib. DE properties all the same. Both are .scx files yet one returns an error when setting ControlSource properties and the one built in the form designer does not. ? They are both built in the form designer but one was dumped from a classlib in the toolbar. You would think the form built from a class would be more flexible since it is a situation where I need to use this form many times in the future. ;)
>>
>>Eric K.
>>
>>>Hi Eric,
>>> You mention being unable to save the DE with a form class. Unfortuantely VFP does not allow a form class to be saved with a DE, only form instances(scx's). Not sure why your AddObject("DataEnvironment"... failed at runtime.
>>>HTH
>>>Ned
>>>> As the battle rages on, I seem to be getting nowhere...
>>>>
>>>>I'm encountering a host of problems with forms. When run as a normal .scx from the project manager myform returns: "The data source for this object must be variable reference"
>>>>
>>>>use mytable in 0 alias dummy
>>>>thisform.Text1.controlsource = dummy.description <-- This line causes the error
>>>>
>>>>If I comment out this line the form .scx runs normally.
>>>>
>>>>The following code causes another error when I attempt to use a class with a DE containing cursor1 and the initial selected alias set to cursor1.
>>>>
>>>>SET CLASSLIB TO vdolib.vcx ADDITIVE
>>>>oPlayForm = CREATEOBJECT('test')
>>>>oPlayForm.dataenvironment.addobject("cursor2","cursor") <-- Causes unknown member error ie: there is no DE contained in this instance
>>>>
>>>>BTW - This error is the same with nothing in the data environment prior to saving as class
>>>>
>>>>I guess I don't understand this error. If I create a form visually with a DE and control sources set(like the wizard), why does it complain it is an unknown member when this form is saved as a class, then created using CREATEOBJECT()? Is this not essentially the same object whether run as .scx or an object created in runtime code? Do I need to oPlayForm.addobject("dataenvironment", "dataenvironment")? I attempted this and got a message saying the object type is invalid for the container. Does this mean the form that was saved as a class does not qualify to contain a DE?
>>>>
>>>>The score is now, VFP - 1
>>>> ERIC - 0
>>>>
>>>>Eric K.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only