If in the Access IDE I select "Form" from the list of Objects and "Open" from the Procedures list, the Sub declaration created for me always has the argument: "Cancel as Integer". Why?
If in the Access IDE I select "Form" from the list of Objects and "Open" from the Procedures list, the Sub declaration created for me always has the argument: "Cancel as Integer". Why?
Because you can Cancel the open action in that event by setting
Cancel = True
So if you were checking for say an OpenArgs() property and it wasn't there, rendering the form useless at that point in time, you can cancel the opening event, and return the user to where they came form.
You do need to catch the error that it can raise in the calling code.
DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
Please use the star below the post to say thanks if we have helped !
↓↓ It's down here ↓↓