Trying to get value in control after udate

Skip Bisconer

Who Me?
Local time
Today, 11:47
Joined
Jan 22, 2008
Messages
285
I am tring to get these two controls to keep the value in them after updating until the user changes the value. One is text and one is numeric. These are the AfterUpdate codes I am using from some previous help on a similar issue. The problem is they go away after updateing occurs. So I am either using this code for the wrong reason or I have messed up the code. Help?
 
A look at the code might help. Usually when data isn't saved it's because the controls aren't bound to fields in the underlying table/query.
 
This is my code I meant to add to my original post. The form is bound to the table I am updating.

Private Sub DeliverySeq_AfterUpdate()
If Not IsNull(Me.DeliverySeq) Then
Me.DeliverySeq.DefaultValue = "#" & Me.DeliverySeq.Value + 1
End If
End Sub

Private Sub RouteID_AfterUpdate()
If Not IsNull(Me.RouteID.Value) Then
RouteID.DefaultValue = """" & Me.RouteID.Value & """"
End If
 
Skip,

You're setting the Default value...

Me.DeliverySeq.DefaultValue

That will only take effect on your next new record.\

Wayne
 
Wayne,
I am assigning a route and sequence number to approximately 500 orders in this table. These orders are in hand and manually distributed to each route basket. I want to assign upwards to 35 orders to a route and seqence them in delivery order. I need those values in RouteID to stay until it is manually changed by the person doing the assign process. I just need the sequence number to advance by 1 until changed manually back to 1, and the routeID to stay until changed manually. How would I go about that with code?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom