Originally Posted by
Knelou
Actually it was giving me the message box because first, I didn't enter all the Codes that figured in my data but I found what was missing and now there is not this msg box appearing anymore. But my field is still not filled with the Timings I want... Ok I'm waiting !
In your form, go to your field with the name Time. You mentioned that you changed the name of the field. I suppose you changed it at the table. We should update it at the form too. Go to the field's properties and on the "Other" tab change the name to "Timing" the code below is revised with this name.
You can paste the following code in your form's "Current" event. It is a lazy way to do things but I think it is a good exercise to learn how some of this works. Also, in the case one of the parameters are not met, I changed the message box. I typed in the value of 9,000. Now, in the case there is no match it should update your field to 9,000 or whatever literal value you type after =.
Code:
Select Case Me.Code
Case "A"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "B"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "C1"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "C2"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "D"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "E"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "F"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "G"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "H"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "I"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case "N"
Me.UDT_ProOther2.Value = Me.Timing.Value
Case Else
Me.UDT_ProOther2.Value = 9000
End Select