ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

ddeÂ_½u°ÝÃD?

ddeÂ_½u°ÝÃD?

³sµ²dde®É¡A¦³®É³sµ²ºÝ·í±¼¤F¡A¥i¬OddeÁÙ¦b¶]¡A¸ê®Æ³£¨S¦³§ó·s¡C
·Q½Ð°Ý¦p¦ó¦Û°Ê§PÂ_¸ê®Æ¨S¦³¦b§ó·s¡A¨Ãµo¥X´£¥Ü¡A¨Ò¦p¤T¬í¤º¡A¸ê®Æ¨S¦³§ó°Ê¡A¦Û°Ê´£¿ô¡C©ÎªÌ¦³§ó¦nªº¤èªk?
ÁÂÁÂ~

¦^´_ 1# ms2001
  ¨Ï¥Î QueryTable ª«¥ó ªºAfterRefresh ¨Æ¥ó ¸Õ¸Õ¬Ý
  1. Dim MyDee As New Class1
  2. Sub SetfDee()
  3.     Set MyDee.QTable = QueryTables(1)
  4.     'QueryTable ¤@­Ó¥Ñ¥~³¡¸ê®Æ¨Ó·½©Ò¶Ç¦^¤§¸ê®Æºc¦¨ªº¤u§@ªí¡C
  5. End Sub
  6. Sub MyDeeRefresh()
  7.     On Error Resume Next
  8.     MyDee.QTable.Refresh 0
  9.     'Me.QueryTables(1).Refresh 0 '¤]¥i¥H
  10. End Sub
½Æ»s¥N½X






  1. Option Explicit
  2. Public WithEvents QTable As QueryTable
  3. Private Sub QTable_AfterRefresh(ByVal Success As Boolean)
  4. MsgBox Success '§P§O ¬O§_ §ó·s¦¨¥\
  5. End Sub
  6. Private Sub QTable_BeforeRefresh(Cancel As Boolean)
  7. 'MsgBox QTable.Name
  8. End Sub
½Æ»s¥N½X

TOP

·PÁª©¥Dªº«ü¾É¡A²Ä¤G¬q¤p§Ì¦³ÂI¬Ý¤£À´­C¡A¥i¥HÀ°§Úª`¸Ñ¤@¤U¶Ü¡AÁÙ¦³°£¤Fdde¥~¡A¦pªG¬O¥Îrtd³sµ²ªº¸Ü¤]¦³¥Î¶Ü?ÁÂÁÂ~

TOP

¦^´_ 3# ms2001
Option Explicit  '¦b¼Ò²Õ¼h¦¸¤¤±j­¢¨C­Ó¦b¼Ò²ÕùتºÅܼƳ£¥²¶·©ú½Tªº«Å§i¡C
Public WithEvents QTable As QueryTable    'WithEvents «Å§i¤@­Ó§t¦³¨Æ¥óªº Application Ãþ«¬ª«¥ó¡C
Private Sub QTable_AfterRefresh(ByVal Success As Boolean)  'Success Success As Boolean   ¦pªG¬d¸ß¦¨¥\§¹¦¨«h¬° True
MsgBox Success '§P§O ¬O§_ §ó·s¦¨¥\   
End Sub

Private Sub QTable_BeforeRefresh(Cancel As Boolean)
'  Cancel   ·í¨Æ¥óµo¥Í®É¬° False¡C¦pªG¸Ó¨Æ¥óµ{§Ç±N¦¹¤Þ¼Æ( Cancel )³]©w¬° True¡A«h¸Óµ{§Çµ²§ô«á±N¤£§ó·s¡C
   'MsgBox QTable.Name
End Sub

TOP

G¤j±z¦n
§Ú°õ¦æSet MyDee.QTable = QueryTables(1) ¦¹¬qµ{¦¡½X·|¥X²{¿ù»~,½Ð±Ð¦p¦ó¸Ñ¨M

TOP

        ÀR«ä¦Û¦b : ·R¤£¬O­n¨D¹ï¤è¡A¦Ó¬O­n¥Ñ¦Û¨­ªº¥I¥X¡C
ªð¦^¦Cªí ¤W¤@¥DÃD