Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DoCmd.OpenForm in add mode (A2000)

    Unsure of syntax in the DoCmd to open the form in data entry mode. Can you assist?

    Dim strFormName As String
    Dim frm As Form

    strFormName = "frmEnterCSZ"

    DoCmd.OpenForm strFormName
    Set frm = Forms(strFormName)

    E

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DoCmd.OpenForm in add mode (A2000)

    Use this:

    DoCmd.OpenForm strFormName, , , , acFormAdd

    or

    DoCmd.OpenForm FormName:=strFormName, DataMode:=acFormAdd

    The first uses arguments by position, the second by name, but they do exactly the same.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd.OpenForm in add mode (A2000)

    Thanks. I was doing this:

    DoCmd.OpenForm (strFormName, , , , acFormAdd)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DoCmd.OpenForm in add mode (A2000)

    DoCmd.OpenForm is not a function, but a procedure, so you shouldn't use brackets, unless you use Call:

    Call DoCmd.OpenForm(strFormName, , , , acFormAdd)

Posting Permissions

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