Hi Mike,
Maybe you can check this code if suitable to you or not,
If lOnline
_Cust_file = "&_Net_Dir\data\services\"+_cust_item
_Cust_Itemdb = "&_Net_Dir\data\services\"+_Cust_Item+".Dbf"
If File(_Cust_Itemdb)
If !used(_cust_item)
Use &_Cust_file in 0 shared
Else
Select('&_Cust_item')
Endif
Else
Messagebox("Services File is Missing!"+CHR(13)+;
"The system will create for you..",0+48,"",1900)
Select('Serv_det')
Copy stru to "&_Net_Dir\Data\Services\"+"DP"+Allt(xcustid) with cdx
_Cust_file = "&_Net_Dir\data\services\"+_cust_item
_Cust_Itemdb = "&_Net_Dir\data\services\"+_Cust_Item+".Dbf"
If !used(_cust_item)
Use &_Cust_file in 0 shared
Else
Select('&_Cust_item')
Endif
Endif
Else
_Cust_file = "C:\Helpdesk\data\services\"+_cust_item
_Cust_Itemdb = "&_Work_Dir\data\services\"+_Cust_Item+".Dbf"
If file(_Cust_itemdb)
If !used(_cust_item)
Use &_Cust_file in 0 shared
Else
Select('&_Cust_item')
Endif
Else
Messagebox("Services File is Missing!"+CHR(13)+;
"The system will create for you..",0+48,"",1900)
Select('Serv_det')
Copy stru to "&_Work_Dir\Data\Services\"+"DP"+Allt(xcustid) with cdx
_Cust_file = "&_Work_Dir\data\services\"+_cust_item
_Cust_Itemdb = "&_Work_Dir\data\services\"+_Cust_Item+".Dbf"
If !used(_cust_item)
Use &_Cust_file in 0 shared
Else
Select('&_Cust_item')
Endif
Endif
ENDIF