What do all the commas mean

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bowtie
    New Member
    • Oct 2007
    • 25

    What do all the commas mean

    if a code is written like below what does it mean:

    Code:
    project1.openform form1 ,,,,
    i'm mainly concerned about the commas wat do they imply and what can be put after these commas
  • code937
    New Member
    • Sep 2007
    • 24

    #2
    at a complete guess its just empty variables...

    Comment

    • hariharanmca
      Top Contributor
      • Dec 2006
      • 1977

      #3
      Can you explain what version of VB you are using?

      Comment

      • SammyB
        Recognized Expert Contributor
        • Mar 2007
        • 807

        #4
        Originally posted by bowtie
        if a code is written like below what does it mean:

        Code:
        project1.openform form1 ,,,,
        i'm mainly concerned about the commas wat do they imply and what can be put after these commas
        OpenForm has seven parameters. all of which are optional except the first one, which is the form name, so your commas just indicate that there are missing parameters, but white space works just as well and is not as confusing. So, assuming you have a form named Form1, your line of code should be:
        Code:
         DoCmd.OpenForm "Form1"
        	or better
        DoCmd.OpenForm Form1.Name
        	or you could add some commas, but nobody does
        DoCmd.OpenForm Form1.Name,,,,,,
        	unless you wanted to use one of the optional parameters:
        DoCmd.OpenForm Form1.Name,,,"LastName = 'Smith'"
        	but a better way is
        DoCmd.OpenForm FormName:=Form1.Name, WhereCondition:="LastName = 'Smith'"
        see http://msdn2.microsoft.com/en-us/library/bb238021.aspx for more details on OpenForm

        Comment

        Working...