Currently I have a line of code that is:
Private Sub Form_Open(Cancel As Integer)
Me.Assign_Porter.SetFocus
End Sub
I have now changed the form design a bit so that the field "Assign.porter" is not always present (I turned allow additions off) whereas before it was. Now i get errors when the field is not there that the code cannot run.
How do i set the VBA now so that it sets focus to the field only when it is present in the form and if it is not present then it does nothing?
Thank you
Private Sub Form_Open(Cancel As Integer)
Me.Assign_Porter.SetFocus
End Sub
I have now changed the form design a bit so that the field "Assign.porter" is not always present (I turned allow additions off) whereas before it was. Now i get errors when the field is not there that the code cannot run.
How do i set the VBA now so that it sets focus to the field only when it is present in the form and if it is not present then it does nothing?
Thank you
Last edited: