• Use of := in VBA (win XP SR2)

    Author
    Topic
    #434269

    What is the meaning of the symbols := in VBA? As I was studying some code I came accross the following:
    DoCmd.OpenForm “frmProductAdd”, DataMode:=acFormAdd, WindowMode:=acDialog ………………

    Viewing 0 reply threads
    Author
    Replies
    • #1023450

      Those represent named arguments and the values you are passing into them. There are two ways to pass in arguments. Here’s the OpenForm syntax shwoing the declared arguments:

      OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)

      You can use it by calling the routine and filling in the blanks between commas to represent the arguments in the order expected, ommitting any optional values you don’t need:

      DoCmd.OpenForm "frmNavigate1", , , , acFormReadOnly, acDialog

      You can use named arguments instead, which do not rely on the position of the argument in the call

      DoCmd.OpenForm "frmProductAdd", DataMode:=acFormAdd, WindowMode:=acDialog

    Viewing 0 reply threads
    Reply To: Use of := in VBA (win XP SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: