J
Jaazaniah
Hey all,
I have a continuous subform that lists a calcuated field based on a
table value. Here's some sample code:
Private Sub Hours_GotFocus()
Me.Hours.ControlSource = ""
Me.Hours.Text = Round(Me.sngDuration / 60, 2)
Me.Hours.SelStart = 0
Me.Hours.SelLength = Len(Me.Hours.Text)
End Sub
Private Sub Hours_LostFocus()
Me.sngDuration = CSng(Me.Hours.Text) * 60
Me.Hours.ControlSource = "=Round([sngDuration]/60,2)"
Me.dtDateTime.SetFocus
DoCmd.GoToRecord , , acNext
End Sub
What I've noticed is that the whole column of fields has their control
sources reset. This is apparently normal, but has anyone found a work
around to allow for just the active record to be affected? or am I
splitting hairs? Mostly I'm looking to avoid having the user be
confused when the column changes. I've tried a 2nd text box to toggle
visibility and calulate based on that with focus juggling, and it also
has the same effect.
I have a continuous subform that lists a calcuated field based on a
table value. Here's some sample code:
Private Sub Hours_GotFocus()
Me.Hours.ControlSource = ""
Me.Hours.Text = Round(Me.sngDuration / 60, 2)
Me.Hours.SelStart = 0
Me.Hours.SelLength = Len(Me.Hours.Text)
End Sub
Private Sub Hours_LostFocus()
Me.sngDuration = CSng(Me.Hours.Text) * 60
Me.Hours.ControlSource = "=Round([sngDuration]/60,2)"
Me.dtDateTime.SetFocus
DoCmd.GoToRecord , , acNext
End Sub
What I've noticed is that the whole column of fields has their control
sources reset. This is apparently normal, but has anyone found a work
around to allow for just the active record to be affected? or am I
splitting hairs? Mostly I'm looking to avoid having the user be
confused when the column changes. I've tried a 2nd text box to toggle
visibility and calulate based on that with focus juggling, and it also
has the same effect.