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

    syntax error on conversion (a2000)

    In converting an A97 to A2000 I got a syntax error on the following:

    Option Compare Database 'Use database order for string comparisons
    Global PrevCtrl As Control
    Global CurDate As Variant

    Function OpenCal(pCtrl As Control)
    Dim strCtrl As String
    Set PrevCtrl = pCtrl
    strCtrl = pCtrl.Name
    DoCmd OpenForm "Calendar", , , , , A_DIALOG, strCtrl (this is the line producing the error)
    pCtrl = CurDate
    End Function

    My knowledge of code is limited. Any anyone give me some pointers on correcting the syntax?

    E Wilson

  2. #2
    Lounger
    Join Date
    Mar 2003
    Location
    Gainesville, Florida, USA
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax error on conversion (a2000)

    It should be:

    DoCmd.OpenForm "Calendar", , , , , A_DIALOG

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

    Re: syntax error on conversion (a2000)

    Hi Elizabeth,

    MichaelAngelo (happy 528th birthday!) has already pointed out that you should use a period between DoCmd and OpenForm: DoCmd.OpenForm instead of DoCmd OpenForm.
    Apart from that, the A_DIALOG constant is still valid, but it's a leftover from Access version 2 somewhere in the early 90's. The "modern" equivalent of it is acDialog.

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

    Re: syntax error on conversion (a2000)

    That fixed it. Thanks!

Posting Permissions

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