masoud_sedighy
Registered User.
- Local time
- Yesterday, 17:48
- Joined
- Dec 10, 2011
- Messages
- 132
I would like continouse subform as a list box in my file. Now when click fields on my form the entire record will not be highlighted.
In the sample I have found from the net when click on each field in the form entire row will be highlighted. So I try to using function in the sample for my own but it does not work and when I click on each field just that field in 1 second will be highlighted and entire row will not be highlighted.
In the sample I have found from the net when click on each field in the form entire row will be highlighted. So I try to using function in the sample for my own but it does not work and when I click on each field just that field in 1 second will be highlighted and entire row will not be highlighted.
Private Sub P_ForceHighLight()
On Error Resume Next
Dim ct As Control, ct1 As Control
[FONT="][/FONT]
DoCmd.Echo False
Set ct1 = ActiveControl
For Each ct In Me.Detail.Controls
ct.SetFocus
Next
ct1.SetFocus
DoCmd.Echo True
[FONT="][/FONT]
ExitPoint:
Set ct = Nothing
Set ct1 = Nothing
[FONT="][/FONT]
' Note - This work-around is found necessary
' in continuous form, for ensuring that
' conditional highlight takes effect promptly.
' (No such problem for datasheet form)
On Error GoTo 0
End Sub
----------------------------------------------------
Private Sub Item_Name_Click()
P_Click
End Sub
[FONT="] [/FONT]
Private Sub Item_Number_Click()
P_Click
End Sub
----------------------------------------------------------------
Private Sub P_Click()
On Error Resume Next
Dim ct As Control
Dim Pos As Long
[FONT="][/FONT]
Pos = Me.Recordset.AbsolutePosition
Set ct = ActiveControl
[FONT="][/FONT]
' Clear other selections
P_ClearSelections
Me.Recordset.AbsolutePosition = Pos
[FONT="][/FONT]
Me.IsSelected = True
ct.SetFocus
[FONT="][/FONT]
' Save the status
Me.Dirty = False
' Force conditional highlighting
P_ForceHighLight
[FONT="][/FONT]
' Update display of SF_Selected
Me.Parent("SF_Selected").Requery
[FONT="][/FONT]
ActiveControl.SelLength = 0
[FONT="][/FONT]
Set ct = Nothing
On Error GoTo 0
End Sub