Assign ID to one field based on another field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The two fields are customer and BookingNo. IF the customer = "A" then I need
the BookingNo to be populated with any five digit character. IF the customer
is anything else, I need the same BookingNo to = null. Please include code
in your answer.
 
Try this code, on the after update event of the customer field

If Me.[Customer field name] = "A" Then
Me.[BookingNo field name] = "ABCDE"
Else
Me.[BookingNo field name] = ""
End If

Please enter in the brackets the name of the fields in your form
 
Back
Top