the code below will not make a new record.
it just goes to the record in the table that last had focus,
that means that it can go to the first record or any other record that had focus.
It just begins to overwrite whatever record it goes to.
This code snippet is preceeded by a progressive search for the customer id #. The transfer of the id # and the focus activation of the date field work just fine.
How do I make it -- start a new record????
it just goes to the record in the table that last had focus,
that means that it can go to the first record or any other record that had focus.
It just begins to overwrite whatever record it goes to.
This code snippet is preceeded by a progressive search for the customer id #. The transfer of the id # and the focus activation of the date field work just fine.
How do I make it -- start a new record????
Code:
IF a_dlg_button = "&OK" THEN 'Get 'Value' property of 'Cus_id' in Form 'fmtype_srch' . DIM window_name as C window_name = ":"+"fmtype_srch" DIM varP_Object as p 'Get a pointer to the specified window varP_Object = obj(window_name) vc_cusid = varP_Object:Cus_id.value vc_cus_lastname = varP_Object:Cus_Name_Last.value '====================================== 'Is the problem in the next line???? 'This is copied from chm.... :fmtype_cusform.new_record() '====================================== :fmtype_cusform:tbl_cus_id.value=vc_cusid 'next line just closes the 'searching' form fmtype_srch.close() 'Activate object 'Tx_date' in Form 'fmtype_cusform' . DIM window_name as C window_name = ":"+"fmtype_cusform" DIM varP_Object as p 'Get a pointer to the specified window varP_Object = obj(window_name) 'Check if the specified window exists if .not. is_object(varP_Object) then ui_msg_box("Error","The window '"+window_name+"' does not exist.",ui_stop_symbol) else varP_Object:Tx_date.activate() end if END IF ' the following lines (other than 'end') do not apply if pass_no=.f. then fmtype_srch.close() end if %code%) if pass_no=.t. goto repeat_lookup end if END
Comment