Closing Forms
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 277   1
URL.หัวข้อ / URL
Closing Forms

ถามไว้ที่ http://www.utteraccess.com/forums/showflat.php?Cat=&Board=access_2000&Number=159542&page=0&view=collapsed&sb=5&o=7&fpart=1&vc=1&PHPSESSID= 
 
เขาต้องการปิดฟอร์มที่เปิดทิ้งไว้ ผมเลยให้โค้ดเขาไปดังนี้ครับ 
 
code:-------------------------------------------------------------------------------- 
Private Sub cmdCloseForm_Click() 
Dim strForm As String 
strFom ="YourFormName" 
If IsLoaded(strForm) Then 
   DoCmd.Close acForm, strForm 
End If 
End Sub 
 
Function IsLoaded(ByVal strFormName As String) As Boolean 
 ' Returns True if the specified form is open in Form view or Datasheet view.            
    Const conObjStateClosed = 0 
    Const conDesignView = 0 
    If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then 
        If Forms(strFormName).CurrentView <> conDesignView Then             
              IsLoaded = True 
        End If 
    End If 
End Function   
 
-------------------------------------------------------------------------------- 
 

1 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R06663
   
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0744s