S. McCann
11-23-2001, 07:43 AM
I have a form with fields "From" & "To". I would like to be able to have the "To" value automatically become the "From" value for each successive record.
ie: FROM To
5.0 6.5
6.5 7.0
7.0 8.1
Any help would be greatly appreciated.
raskew
11-24-2001, 05:09 AM
A fairly simple way is, in the AfterUpdate event of the control, set the default for that control as its current value. Here's an example of a text box containing a numeric entry. Note that the format will change slightly if referring to text or date (examples shown).
Private Sub FacilityID_AfterUpdate()
If Not IsNull(Me.FacilityID) Then
Me.FacilityID.DefaultValue = "=" & Me.FacilityID
'Use 'For text fields 'Me.Operatorid.DefaultValue = "='" & Me.OperatorID & "'"
'For date fields 'Me.Operatorid.DefaultValue = "=#" & Me.Operatorid & "#"
'For number fields 'Me.Operatorid.DefaultValue = "=" & Me.Operatorid
Me.FacilityID.TabStop = False
Else
Me.FacilityID.TabStop = True
End If
End Sub
S. McCann
11-26-2001, 06:19 AM
Thanks raskew. You have just made my day http://www.access-programmers.co.uk/ubb/smile.gif