Reputation: 45
This is driving me up a wall. I have this very simple code to fill in another field on the update of Customer field.
Private Sub Customer_AfterUpdate()
Me.File_path = Me.Last_Name & " " & Me.First_Name
End Sub
And it returns invalid outside procedure
for the line private sub customer afterupdate()
What ever could I be doing wrong?
Upvotes: 1
Views: 737
Reputation: 1502
This error is a compile error rather than a runtime error.
It usually occurs when there is unrecognised text out side of a procedure. Likely causes are stray/accidental/extra sub
or end sub
lines.
This can also be caused where public variables are given an incorrect or unacceptable data type. This is just another example of text that is unrecognised and outside the bounds of a procedure.
Upvotes: 1