Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Location
    Guatemala City
    Posts
    515
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use of := in VBA (win XP SR2)

    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 ..................

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

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

    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:

    <code> DoCmd.OpenForm "frmNavigate1", , , , acFormReadOnly, acDialog</code>

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

    <code>DoCmd.OpenForm "frmProductAdd", DataMode:=acFormAdd, WindowMode:=acDialog</code>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •