>Hi, Ravi!
>
>>>
>No, I tie textboxes to varaiables
><<
>
>Why do you do this this way?
>
>The better way to encapsulate all storage (means also all variables) of a form is to store it within the form itself:
>
>- mMedName is declared as
property of the form
>-
ThisForm.mMedName is the ControlSource for Text1.
>- If the user enters a new value into Text1, this new value is then inserted into the Prescriptions table, when the Save button is clicked.
>
>
INSERT INTO Prescriptions(PresRef, MedName, orderdate, healthnum,;
>docnum, docname, physref,PatientNam) ;
>VALUES (mTabRef, <b>ThisForm</b>.mMedName, mdate, mHealthNum, mDocnum, mDoctor, mPhysRef,;
> mPatientName)
>
>* Clear the contents of the variable to hold new info
>ThisForm.mMedName = ""
>
>
>The result is the same, but no conflicts with other forms!
>
>BTW: Using such possibilities of encapsulation is one of the important issues of OOP!
>From here comes the "Golden Rule" of OOP in VFP: Never more than one PUBLIC variable is allowed, and this one is used for goApp - all other stuff is stored in properties!
I'll give it a shot Sebastian.
- Ravi
- Ravi
True greatness consists in being great in little things.
- Charles Simmons