Hi John,
One way to handle what you are doing is to create a custom method in you form called Search. You add a method through the Form -> New Method menu.
Put all your code in that method. You can access the the values entered in the textboxes with
ThisForm.MyText1.Value
.
Now just put
ThisForm.Search
in your command buttons click event and the code will run.
Now if some other control needs to start the search it can also call that same method.
AFA the vars are concerned you can make them local to the search method or just use the TextBox.Value property.
hth
. >Thank You Kenneth,
>
>I just can't figure out way this is so hard. There are so many places to put code in this software it blows my mind. If you could point me in the right direction it would help to no end. I've got the search form ready to go. My problem is I don't know where to put the code. I have a command button to start the search, where do I store the varabiles and how do I relate them to the text box's in my screen. Does it make it any more complacated by accessing more then one table. Please point me in the right direction.
>Thanks again
Roi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!