| 上一篇主題 :: 下一篇主題   | 
	
	
	
		| 發表人 | 
		內容 | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 1 樓
  | 
		
			
				 發表於: 星期一 十月 01, 2018 2:31 pm    文章主題: Grid 捲軸往下移動後原設定的關聯出現錯誤 | 
				     | 
			 
			
				
  | 
			 
			
				各位是否有遇過類似的問題嗎?
 
 
出貨單主表有設定客戶資料的關聯
 
程式開始執行時 Grid 顯示 出貨單的客戶代號、客戶名稱 是正常的
 
 
但在Grid 捲軸往下拉的時候,卻出現錯誤的關聯
 
例如 客戶A 的代號,卻顯示客戶B的客戶名稱
 
 
P.S Grid 捲軸並無寫任何程式 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		garfield Site Admin
  
  註冊時間: 2003-01-30 文章: 2160
 
  第 2 樓
  | 
		
			
				 發表於: 星期一 十月 01, 2018 4:42 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				通常是你在不同的table 都有設定客戶資料的關聯
 
類似以下的狀況
 
sele Atable
 
set rela to cust_no into cust
 
set rela to pro_no into product addi
 
 
sele product
 
set rela to cust_no into cust _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 3 樓
  | 
		
			
				 發表於: 星期一 十月 01, 2018 5:11 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | garfield 寫到: | 	 		  通常是你在不同的table 都有設定客戶資料的關聯
 
類似以下的狀況
 
sele Atable
 
set rela to cust_no into cust
 
set rela to pro_no into product addi
 
 
sele product
 
set rela to cust_no into cust | 	  
 
 
 
Dear garfield,
 
 
我的作法是
 
單一主檔多個欄位關聯多個Table的欄位
 
sele Atable 
 
set rela to cust_no into cust 
 
set rela to pro_no into product addi 
 
 
以garfield的例子說明,
 
並無第二個 Table 再去關聯 cust 或 product
 
 
請問還有其他的可能性嗎? | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		garfield Site Admin
  
  註冊時間: 2003-01-30 文章: 2160
 
  第 4 樓
  | 
		
			
				 發表於: 星期一 十月 01, 2018 10:48 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				list stat to temp.txt
 
modi comm temp.txt
 
去查看看看所有table設定的狀態
 
 
不然將form 設成私有的資料
 
thisform.DataSession=2 _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 5 樓
  | 
		
			
				 發表於: 星期二 十月 02, 2018 8:20 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | garfield 寫到: | 	 		  list stat to temp.txt
 
modi comm temp.txt
 
去查看看看所有table設定的狀態
 
 
不然將form 設成私有的資料
 
thisform.DataSession=2 | 	  
 
 
 
DataSession 原本就設定為 2
 
 
 
補充另一現象,看看有無幫助思考
 
拉動捲軸後會關聯的客戶名稱會亂掉,但再點選Grid之後又恢復正常
 
拉動捲軸後又亂掉 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		lygcw9603
 
 
  註冊時間: 2011-12-25 文章: 130
 
  第 6 樓
  | 
		
			
				 發表於: 星期二 十月 02, 2018 11:43 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				| 用SQL代碼作為數據源試試 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 7 樓
  | 
		
			
				 發表於: 星期三 十月 03, 2018 8:34 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | lygcw9603 寫到: | 	 		  | 用SQL代碼作為數據源試試 | 	  
 
 
不太清楚 "用SQL代碼作為數據源" 的意思
 
可否詳細告知  謝謝 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		garfield Site Admin
  
  註冊時間: 2003-01-30 文章: 2160
 
  第 8 樓
  | 
		
			
				 發表於: 星期三 十月 03, 2018 9:13 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				是否忘了thisform.LockScreen=.f. _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 9 樓
  | 
		
			
				 發表於: 星期三 十月 03, 2018 9:46 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | garfield 寫到: | 	 		  | 是否忘了thisform.LockScreen=.f. | 	  
 
 
原本預設就是 .F.,所以應該不是這個問題。 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		garfield Site Admin
  
  註冊時間: 2003-01-30 文章: 2160
 
  第 10 樓
  | 
		
			
				 發表於: 星期三 十月 03, 2018 2:58 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				找到類似問題, 別人的回答
 
Some idea's:
 
a) try this.visible=.t. in .Scrolled event
 
b) try thisform.draw in .Scrolled event
 
c) try sys(602,0)
 
d) check .Scrolled event code. As vfp help says: "Screen painting problems can occur when the grid or form is scrolled. Therefore, avoid creating wait states, for example, using the WAIT WINDOW command, within the Scrolled event.
 
" _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 11 樓
  | 
		
			
				 發表於: 星期四 十月 04, 2018 9:13 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | garfield 寫到: | 	 		  找到類似問題, 別人的回答
 
Some idea's:
 
a) try this.visible=.t. in .Scrolled event
 
b) try thisform.draw in .Scrolled event
 
c) try sys(602,0)
 
d) check .Scrolled event code. As vfp help says: "Screen painting problems can occur when the grid or form is scrolled. Therefore, avoid creating wait states, for example, using the WAIT WINDOW command, within the Scrolled event.
 
" | 	  
 
 
 
已測試過 沒有效果 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		ooctiger
 
 
  註冊時間: 2014-04-02 文章: 23
 
  第 12 樓
  | 
		
			
				 發表於: 星期四 十月 04, 2018 9:23 am    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				突然有一個想法 既然人工點選Grid可以恢復正常 (Grid.AfterRowChange的動作)
 
 
那如果在 捲軸動作後,
 
讓Grid同時能夠指到捲動後出現在Grid可視畫面的第一筆,應該可以解決問題
 
 
但是我沒有辦法預測出捲動後,在Grid 可視畫面的第一筆是哪一筆 ?
 
第二,在知道是哪一筆後我如何讓Gird 停留在該筆,然後執行 Grid.AfterRowChange
 
 
懇請各位狐友 賜教 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		CPS0204
 
 
  註冊時間: 2014-08-24 文章: 482
 
  第 13 樓
  | 
		
			
				 發表於: 星期五 十月 05, 2018 4:36 pm    文章主題: 有 | 
				     | 
			 
			
				
  | 
			 
			
				有遇過relation 出問題,有時可以有時不行,造成困擾
 
目前改善方法:
 
 
1.不再使用RELATION
 
2.在GRID中,使用真實的TABLE欄位,也就是每欄都是真實的,然後REPLACE值
 
例:
 
CREA CURSOR TEMP_BODY (品號 C(30),品名規格 C(60),單位 C(4),數量 N( )
 
然後先將 (品名規格) REPLACE WITH 產品檔.品名規格
 
...
 
...
 
...
 
 
等作法,不再相信RELATION
 
3.使用JOIN 造法:
 
SELECT A.*,B.PROC_NAME,B.PROC_UNIT FROM 出貨單身 A LEFT JOIN PROCTION B ON A.PROC_NO=B.PROC_NO INTO CURSOR TEMP1
 
 
可以馬上造成一個暫存檔,若要可修改,請加入READWRITE參數 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		syntech
 
 
  註冊時間: 2003-05-16 文章: 4252 來自: Taipei,Taiwan
  第 14 樓
  | 
		
			
				 發表於: 星期二 十月 09, 2018 8:57 pm    文章主題:  | 
				     | 
			 
			
				
  | 
			 
			
				Grid.BeforeRowChange
 
 	  | 代碼: | 	 		  
 
sele Atable 
 
set rela to
 
 | 	  
 
 
Grid.AfterRowChange
 
 	  | 代碼: | 	 		  
 
sele Atable 
 
set rela to cust_no into cust 
 
set rela to pro_no into product addi 
 
 | 	  
 
 
 
----
 
這樣有效嗎? _________________ 如果公司有下列困擾:
 
1. 找不到便宜,快速,簡易的 生產排程軟體
 
2. 不知道如何快速排定 採購計劃
 
3. 成本抓不準,自己算比軟體算有用
 
4. 想學習系統規劃,想找系統架構的顧問
 
 
請聯絡我們,也許我們幫得上忙 | 
			 
		  | 
	
	
		| 回頂端 | 
		 | 
	
	
		  | 
	
	
		 |