Hi again everyone,
I tried to create a calculated field in my table with a lot of IIF statements but I think there are too many caracters because I have an error message saying "expression too complex". So i tried to do it in in a Module (VBA). In the main window, under Option Compare Database, I created a new Sub procedure (I think it's the way to do it) and under, I put my formulas. Looks like this (actually it's longer than that but it's just the beginning of it so you can understand):
Public Sub Code()
If [Code] = "A" Then
[UDT Pro - other2] = [Time]
ElseIf [Code] = "B" Then
[UDT Pro - other2] = [Time]
ElseIf [Code] = "C1" Then
[UDT Pro - other2] = [Time]
ElseIf [Code] = "C2" Then
[UDT Pro - other2] = [Time]
ElseIf [Code] = "C3" Then
[UDT Pro - other2] = [Time]
End If
End Sub
My problem is that when I want to run it, it says: "Complie Error : External Name not defined"... I tried also with "Public Sub Code_AfterUpdate()" as it saw on forums but still does not work. Any idea? Thanks !