Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cretaing Object Of A Form 1

Status
Not open for further replies.

progfox

Programmer
Jun 15, 2003
43
IN
Dear Sir,

Will Any One Plse Tell ME If We Can Create Object of a form In Visusal foxpro. Actually what I wanted to do is........
"I ahev cerated a form say Transaction. Suppose the textboxes of the form are buyer's name,stylename and Itemname. Now when i am doing the transaction I didn't find the Item name in the Item DBF. So I have to add the new one. Ihave Put a button having caption "add new items". When the User clicks over there a new form will be diplayed for entering in iTem dbf. Now I want to put the value of the from the transaction form to the item form. In VB this was possible only by giving the references of the form name . Now I want ask whether the same is possible in this form or not"

Regards

Chadnan
 
progfox,

A few ways to do this...

[ol][li]DO FORM Transaction NAME frmTrans
The name clause will create a reference to your form called frmTrans...you can then refer to frmTrans.Text1.value or whatever in your Items form...such as in the Items form's Init event to set default values for the textboxes and whatever.

[/li][li]DO FORM Items with thisform.text1.value, Thisform.text2.value
This method utilizes VFP's ability to send parameters to the Init Event of the Items form...just add
Lparameters lText1, lText2 to the Init event of the Items form and you will be able to see the values...you could send the entire Transaction form over if you wanted
DO FORM Items with thisform

[/li][li]The third way is to create some variables to hold the values you need and scope them in the Transaction form so that they can be seen from the Items form...
Public cText1Val, cText2Val
Remember to release these public variables in the Unload or Destroy event of the transaction form.[/li][/ol]

As a general rule I would utilize the first of these three suggestions, but I don't know your exact requirements so I'll leave it to you to decide which is best suited to your needs.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Hi Chadnan,

Dont worry, you are having many of achieving the same thing in VFP.

You can create a generic way of handling searching of items.

Look in the FAQ
A sample Search Form.
faq184-2858

Now, imagine you are adding a button into this generic searchform with click event code..
myForm = ThisForm.MasterForm
DO FORM &myForm

Pass the master forms name as parameter when you call a search form... then in its init event store it to ThisForm.masterForm property.. do the searching.. and if the user wants to add a new master.. Call that thru the button.. and then you are back to this search form when the master add/edit is over.. and then pass back to the called form.

SO this will become a generic search form. While The FAQ given above is a small sample search form, you can input features of incremental searches, filter technics and order technics etc in the generic search form. :)

ramani :)
(Subramanian.G)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top