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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form to Form setting Value for field and retrieving only identical val

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
I have a form with a command button that when clicked opens another form. I have a field labeled workorder on both of them, my question is how do I have the command button only open the records with identical workorder numbers and if there is no record to set the workorder number equal to the workorder number off the main.
 
Assumed, the forms have separate DBF or Data session

DO the second form with a passed on parameter with the first forms work order number. In the init event of the second form, set a filter to the passed on parameter value.

DO FORM secondform WITH cWorkOrder && in first form

Second Forms Init event shall have the
PARAMETERS cMyWorkOrder

PRIVATE cWorkOrder
m.cWorkOrder = cMyWorkOrder
Select MyDBF
SET FILTER TO dbfWorkOrder = m.cWorkOrder

(Please note that the memory variable is used since the passed onn parameters will not be available to filter condition in the remaining routines.)

Alternatively, the selected work order can be passed on as a global variable and the filter is set on the second form to match with that global variable.

ramani :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top