選擇代碼可以使用docmd.runcommand accmdselectrecord,但如何通過代碼判斷一條記錄是否被選擇呢 me.CurrentRecord和me.SelTop 和 me.SelHeight 和 me.SelWidth me.CurrentRecord 得到當(dāng)前記錄數(shù) me.SelTop 判斷 當(dāng)前被高亮選中的最小記錄號 me.SelHeight =1 表示 1個記錄被選中 me.SelWidth=字段數(shù) 表示一個記錄的內(nèi)容全部被選中 ------------------------- 例子,假設(shè)字段數(shù)為 4 With Me.表1_子窗體.Form If .SelHeight > 0 And .SelWidth = 4 Then MsgBox "當(dāng)前記錄號:" & .CurrentRecord & vbCr & "當(dāng)前整行選中的記錄:" & .SelTop & "->" & (.SelTop + .SelHeight - 1) End If End With |
|站長郵箱|小黑屋|手機(jī)版|Office中國/Access中國
( 粵ICP備10043721號-1 )
GMT+8, 2025-7-13 08:08 , Processed in 0.070248 second(s), 16 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.