他の 2 つのフィールドに基づいてフォーム内の 1 つのフィールドを更新する Form_Load の VBA コードをループしたいと考えています。現在、最初のレコードまたはレコードをクリックしたときにのみ更新されます。
現在、次のようになっています。
Private Sub Form_Current()
If Style = "W" And Size = "120" Then ContainerType = 9
If Style = "W" And Size = "240" Then ContainerType = 2
If Style = "W" And Size = "360" Then ContainerType = 34
If Style = "R" And Size = "120" Then ContainerType = 37
If Style = "R" And Size = "240" Then ContainerType = 5
If Style = "R" And Size = "360" Then ContainerType = 12
If Style = "Y" And Size = "120" Then ContainerType = 24
If Style = "Y" And Size = "240" Then ContainerType = 4
If Style = "Y" And Size = "360" Then ContainerType = 14
If Style = ("2Y") And Size = "120" Then ContainerType = 9
If Style = ("2Y") And Size = "240" Then ContainerType = 25
If Style = ("2Y") And Size = "360" Then ContainerType = 28
If Style = ("3Y") And Size = "120" Then ContainerType = 9
If Style = ("3Y") And Size = "240" Then ContainerType = 51
If Style = ("3Y") And Size = "360" Then ContainerType = 29
End Sub
おそらくこれを行うためのより良い方法がありますか?