Jim ..
You had it right. I should have realized that a form class would want a generic environment without being tied to a DE, so you could reuse the class in situations without a particular DE tagging along.
The basic form has parent info on it and then a grid with child records. The two are linked in a one-to-many relation. So I erased the DE and then opened the two Tables in the Load method with USE stmts and set the relation there and now the Createobject stmt works just fine.
One thing I encountered that was interesting was that you don't seem to be able to use Aliases in the Forms, Class, Load Event - Use stmts. The stmts and all the Load Event code executes fine if you do, but then you get repeated errors "Alias not found" when the code leaves the Load Event area and reaches the textboxes that have a controlsource set to a real Table name. If you don't inc. alias with your Use stmts when you open your tables, and then in subsequent code (like the Set Relation stmt)also use real table names no errors occur.
Anyway ... thanks to you and Dan.
John Fish
JF Serices
------------------------------------------------------
>>Dan ...
>>I'm new to this Thread and when I typed in the question, I removed the quotes around the
>>oForm = createobject("yellow_card") after I went to Send the question into the Thread and
>>some error message popped up about quotes not being allowed.
>>
>>In reality I did use the correct: oForm = createobject("yellow_card")
>>just as you advised and the instantiating error still occurred.
>>
>>Thanks ...
>>John F.
>John,
>
>When you save a form as a class the DE is removed from the form class. So the controlsource may be your problem. Modify the formclass and in its Load event USE TheTable that the control needs and then try createobject().
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement