Results 1 to 2 of 2
  1. #1
    guden is offline Novice
    Windows 10 Access 2021
    Join Date
    Jul 2022
    Posts
    1

    Obscure declaration argument

    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?

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    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 ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Module level variable declaration.
    By bubai in forum Programming
    Replies: 33
    Last Post: 12-12-2020, 11:20 PM
  2. Obscure declaration argument
    By gar in forum Programming
    Replies: 1
    Last Post: 10-24-2019, 01:42 AM
  3. My Blog - Obscure Topics
    By AccessPower in forum Tutorials
    Replies: 0
    Last Post: 02-06-2017, 10:15 AM
  4. Variable Declaration in MS Access 2013 VBA
    By msaccessdev in forum Programming
    Replies: 7
    Last Post: 06-09-2014, 11:09 AM
  5. Replies: 6
    Last Post: 08-23-2012, 05:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums