Hi Guys

Very strange thing is happening in the code.The below code stores values of InputBy,Scandate,FirstLogonTime,LastMITime in the table but for the fields LiveDolphin,BackscanDolphin and LiveBaNCS , nothing gets stored. I have double checked by displaying the values of textbox 27 and textbox40 in a message box and it displays Textbox27.value=5 and Textbox40.value=2 but dont know why the value of textbox40 doesn't get stored in any of the 3 fields.

With rs
    .AddNew
    .Fields("InputBy").Value = user
    
    .Fields("ScanDate").Value = TextBox18.Value
    .Fields("FirstLogonTime").Value = FirstLogon
    .Fields("LastMITime").Value = Format(Now, "hh:mm:ss")
    
    If TextBox27.Value = 4 Then
      .Fields("LiveDolphin").Value = TextBox40.Value
    End If
    
    If TextBox27.Value = 5 Then
      .Fields("BackscanDolphin").Value = TextBox40.Value
    End If
    
    If TextBox27.Value = 1 Then
      .Fields("LiveBaNCS").Value = TextBox40.Value
    End If
    .Update
    End With
    End If
Any help will be much appreciated.

Thanks